fotoshowroom / branches / master / models / gallery.php

history
<?php
class Gallery extends AppModel {

	var $name = 'Gallery';
	var $validate = array(
		'title' => array('alphanumeric'),
		'description' => array('alphanumeric'),
		'date' => array('date')
	);

	var $hasOne = array(
			'Highlight' => array('className' => 'Photo',
								'foreignKey' => 'gallery_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => ''
			)
	);

	var $hasMany = array(
			'Photo' => array('className' => 'Photo',
								'foreignKey' => 'gallery_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			)
	);
	
	function beforeSave() {
		unset($this->data['Gallery']['created']);
	}

}
?>