function hierarchy model hierarchy Filter array Array array value this

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
function hierarchy( $model = 'hierarchy' , $Filter = array() , $Array = array() )
{
$value = $this->First( $model , $Filter );
$this->Path[$value[0]['id']] = $value[0]['name'];
if($value[0]['pid'] != 0)
{
$Filter = array(
'Where'=>array(
'id'=>$value[0]['pid']
)
);
$this->hierarchy( $model , $Filter , $this->Path );
}
else
{
$Array = $this->Path;
return $Array;
}
}