Parents

Navigation:  Development > Function Reference > CategorySet >

Parents

Previous pageReturn to chapter overviewNext page

This function find only root categories.
 

App::CategorySet(NAME)->Parents(FLAG);
 

Flag can "short","long"

 
$data = App::CategorySet('blog-cat')->parents();
 
// Return value
/*

Array

(

    [0] => Array

        (

            [id] => 1

            [fkey] => 0

            [adminref] => 1

            [parentid] => 0

            [image] => 

            [title] => Page Manager

            [description] => 

            [type] => blog-cat

            [generic] => 

            [entrydate] => 2012-12-13 10:47:18

            [lastmodified] => 2012-12-13 10:47:18

        )

 

    [1] => Array

        (

            [id] => 2

            [fkey] => 0

            [adminref] => 1

            [parentid] => 0

            [image] => 

            [title] => Applications

            [description] => 

            [type] => blog-cat

            [generic] => 11

            [entrydate] => 2012-12-13 10:08:41

            [lastmodified] => 2012-12-13 10:08:41

        )

 

)

*/

 

$data = App::CategorySet('blog-cat')->parents('short');
 
// Return
/*Array
(
    [1] => Page Manager
    [2] => Applications
)*/