/app/models/link.php
PHP | 24 lines | 21 code | 2 blank | 1 comment | 0 complexity | 85f65897063287288d197b7ceb9c70ea MD5 | raw file
- <?php
- class Link extends AppModel {
- var $name = 'Link';
- var $validate = array(
- 'link_category_id' => array('numeric'),
- 'name' => array('notempty'),
- 'url' => array('notempty')
- );
- //The Associations below have been created with all possible keys, those that are not needed can be removed
- var $belongsTo = array(
- 'LinkCategory' => array('className' => 'LinkCategory',
- 'foreignKey' => 'link_category_id',
- 'conditions' => '',
- 'fields' => '',
- 'order' => ''
- )
- );
- function beforeFind(&$queryData){
- $queryData['order'] = array('Link.name' => 'ASC');
- }
- }
- ?>