Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- App::uses('AppModel', 'Model');
- class Histories extends AppModel {
- public $useTable = 'histories';
- var $displayField = 'history_name';
- var $hasMany = array(
- 'ChildPage' =>
- array('className' => 'Histories',
- 'foreignKey' => 'parent_id'
- ),
- );
- public function __getAll() {
- $q = $this->find('all', array(
- 'conditions' => array("Histories.parent_id " => NULL),
- 'recursive' => 2,
- 'order' => array('Histories.id' => 'asc')
- ));
- return $q;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement