PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/app/models/link.php

https://github.com/hardsshah/bookmarks
PHP | 24 lines | 21 code | 2 blank | 1 comment | 0 complexity | 85f65897063287288d197b7ceb9c70ea MD5 | raw file
  1. <?php
  2. class Link extends AppModel {
  3. var $name = 'Link';
  4. var $validate = array(
  5. 'link_category_id' => array('numeric'),
  6. 'name' => array('notempty'),
  7. 'url' => array('notempty')
  8. );
  9. //The Associations below have been created with all possible keys, those that are not needed can be removed
  10. var $belongsTo = array(
  11. 'LinkCategory' => array('className' => 'LinkCategory',
  12. 'foreignKey' => 'link_category_id',
  13. 'conditions' => '',
  14. 'fields' => '',
  15. 'order' => ''
  16. )
  17. );
  18. function beforeFind(&$queryData){
  19. $queryData['order'] = array('Link.name' => 'ASC');
  20. }
  21. }
  22. ?>