Skip to content

Instantly share code, notes, and snippets.

@slywalker
Created March 9, 2010 03:24
Show Gist options
  • Save slywalker/326105 to your computer and use it in GitHub Desktop.
Save slywalker/326105 to your computer and use it in GitHub Desktop.
<?php
class Tag extends AppModel {
var $name = 'Tag';
var $validate = array(
'name' => array('notempty')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasAndBelongsToMany = array(
'Post' => array(
'className' => 'Post',
'joinTable' => 'posts_tags',
'foreignKey' => 'tag_id',
'associationForeignKey' => 'post_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