fotoshowroom / branches / master / models / photo.php
history
<?php
class Photo extends AppModel {
var $name = 'Photo';
var $validate = array(
'title' => array('alphanumeric'),
'caption' => array('alphanumeric'),
'approval_date' => array('date'),
'filename' => array('alphanumeric'),
'filetype' => array('alphanumeric')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Gallery' => array('className' => 'Gallery',
'foreignKey' => 'gallery_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'User' => array('className' => 'User',
'foreignKey' => 'user_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
function beforeSave() {
unset($this->data['Photo']['created']);
}
}
?>