* @link http://www.netcommons.org NetCommons Project * @license http://www.netcommons.org/license.txt NetCommons License */ App::uses('LinkListsAppModel', 'LinkLists.Model'); /** * Summary for Linklist Model */ class Linklist extends LinkListsAppModel { /** * Use database config * * @var string */ public $useDbConfig = 'master'; /** * Validation rules * * @var array */ public $validate = array( 'linklists_block_id' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), 'status' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), 'language_id' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), 'is_auto_translated' => array( 'boolean' => array( 'rule' => array('boolean'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), 'url' => array( 'notEmpty' => array( 'rule' => array('notEmpty'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), ); //The Associations below have been created with all possible keys, those that are not needed can be removed /** * belongsTo associations * * @var array */ public $belongsTo = array( 'LinklistsBlock' => array( 'className' => 'LinklistsBlock', 'foreignKey' => 'linklists_block_id', 'conditions' => '', 'fields' => '', 'order' => '' ), 'Language' => array( 'className' => 'Language', 'foreignKey' => 'language_id', 'conditions' => '', 'fields' => '', 'order' => '' ), 'LinklistsCategory' => array( 'className' => 'LinklistsCategory', 'foreignKey' => 'linklists_category_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); /** * hasAndBelongsToMany associations * * @var array */ public $hasAndBelongsToMany = array( 'Block' => array( 'className' => 'Block', 'joinTable' => 'linklists_blocks', 'foreignKey' => 'linklist_id', 'associationForeignKey' => 'block_id', 'unique' => 'keepExisting', 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'finderQuery' => '', ) ); }