Created
March 9, 2010 03:35
-
-
Save slywalker/326123 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Post extends AppModel { | |
var $name = 'Post'; | |
var $validate = array( | |
'user_id' => array('numeric'), | |
'title' => array('notempty') | |
); | |
//The Associations below have been created with all possible keys, those that are not needed can be removed | |
var $belongsTo = array( | |
'User' => array( | |
'className' => 'User', | |
'foreignKey' => 'user_id', | |
'conditions' => '', | |
'fields' => '', | |
'order' => '' | |
) | |
); | |
var $hasAndBelongsToMany = array( | |
'Tag' => array( | |
'className' => 'Tag', | |
'joinTable' => 'posts_tags', | |
'foreignKey' => 'post_id', | |
'associationForeignKey' => 'tag_id', | |
'unique' => true, | |
'conditions' => '', | |
'fields' => '', | |
'order' => '', | |
'limit' => '', | |
'offset' => '', | |
'finderQuery' => '', | |
'deleteQuery' => '', | |
'insertQuery' => '' | |
) | |
); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment