bookmarks /app/models/link.php

Language PHP Lines 24
MD5 Hash 85f65897063287288d197b7ceb9c70ea
Repository https://github.com/hardsshah/bookmarks.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?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');
    }
}
?>
Back to Top