Skip to content

Instantly share code, notes, and snippets.

@jankeesvw
Created June 14, 2010 08:34
Show Gist options
  • Save jankeesvw/437456 to your computer and use it in GitHub Desktop.
Save jankeesvw/437456 to your computer and use it in GitHub Desktop.
<?php
class PhotoAlbum extends AppModel {
var $name = 'PhotoAlbum';
var $displayField = 'title';
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasMany = array(
'PhotoAlbumImage' => array(
'className' => 'PhotoAlbumImage',
'foreignKey' => 'photo_album_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
function beforeDelete(){
$this->PhotoAlbumImage->deleteAll(array("PhotoAlbumImage.photo_album_id" => $this->id));
return true;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment