PHP Class store\components\behaviors\DCategoryTreeBehavior

Author: ElisDN ([email protected])
Inheritance: extends DCategoryBehavior
Mostrar archivo Open project: yupe/yupe

Public Properties

Property Type Description
$parentAttribute model attribute
$parentRelation model parent BELONGS_TO relation
$statAttribute Stat relation name (defined in defaultCriteria)

Public Methods

Method Description
findByPath ( string $path ) : CActiveRecord Finds model by path
getAliasList ( mixed $parent ) : array Returns associated array ($alias=>$fullTitle, $alias=>$fullTitle, .
getAssocList ( mixed $parent ) : array Returns associated array ($id=>$fullTitle, $id=>$fullTitle, .
getBreadcrumbs ( boolean $lastLink = false ) : array Constructs breadcrumbs for zii.widgets.CBreadcrumbs widget
getChildsArray ( mixed $parent ) : array Returns array of primary keys of children items
getFullTitle ( $inverse = false, string $separator = ' - ' ) : string Constructs full title for current model
getLinkActive ( ) : boolean Optional redeclare this method in your model for use (@link getMenuList()) or define in (@link requestPathAttribute) your $_GET attribute for url matching
getMenuList ( integer $sub, mixed $parent ) : array Returns items for zii.widgets.CMenu widget
getPath ( string $separator = '/' ) : string Constructs full path for current model
getTabList ( mixed $parent ) : array Returns tabulated array ($id=>$title, $id=>$title, .
getUrlList ( mixed $parent ) : array Returns tabulated array ($url=>$title, $url=>$title, .
isChildOf ( mixed $parent ) : boolean Checks for current model is child of parent

Protected Methods

Method Description
_childsArrayRecursive ( &$items, &$result, $parent_id )
_getMenuListRecursive ( $items, $parent, $sub ) : array
_getTabListRecursive ( &$items, &$result, $parent_id, integer $indent )
_getUrlListRecursive ( $items, $parent, integer $indent ) : array
arrayFromArgs ( $items ) : array
getChildByAlias ( $alias, null $criteria = null ) : mixed
getFullAssocData ( $attributes, integer $parent ) : array | CDbDataReader
processParents ( $parent ) : array

Private Methods

Method Description
getAttributeValue ( $name, $item )

Method Details

_childsArrayRecursive() protected method

protected _childsArrayRecursive ( &$items, &$result, $parent_id )
$items
$result
$parent_id

_getMenuListRecursive() protected method

protected _getMenuListRecursive ( $items, $parent, $sub ) : array
$items
$parent
$sub
return array

_getTabListRecursive() protected method

protected _getTabListRecursive ( &$items, &$result, $parent_id, integer $indent )
$items
$result
$parent_id
$indent integer

_getUrlListRecursive() protected method

protected _getUrlListRecursive ( $items, $parent, integer $indent ) : array
$items
$parent
$indent integer
return array

arrayFromArgs() protected method

protected arrayFromArgs ( $items ) : array
$items
return array

findByPath() public method

Finds model by path
public findByPath ( string $path ) : CActiveRecord
$path string
return CActiveRecord model

getAliasList() public method

..)
public getAliasList ( mixed $parent ) : array
$parent mixed number, object or array of numbers
return array

getAssocList() public method

..)
public getAssocList ( mixed $parent ) : array
$parent mixed number, object or array of numbers
return array

getBreadcrumbs() public method

Constructs breadcrumbs for zii.widgets.CBreadcrumbs widget
public getBreadcrumbs ( boolean $lastLink = false ) : array
$lastLink boolean if you can have link in last element
return array

getChildByAlias() protected method

protected getChildByAlias ( $alias, null $criteria = null ) : mixed
$alias
$criteria null
return mixed

getChildsArray() public method

Returns array of primary keys of children items
public getChildsArray ( mixed $parent ) : array
$parent mixed number, object or array of numbers
return array

getFullAssocData() protected method

protected getFullAssocData ( $attributes, integer $parent ) : array | CDbDataReader
$attributes
$parent integer
return array | CDbDataReader

getFullTitle() public method

Constructs full title for current model
public getFullTitle ( $inverse = false, string $separator = ' - ' ) : string
$separator string
return string

getLinkActive() public method

Optional redeclare this method in your model for use (@link getMenuList()) or define in (@link requestPathAttribute) your $_GET attribute for url matching
public getLinkActive ( ) : boolean
return boolean true if current request url matches with category path

getMenuList() public method

Returns items for zii.widgets.CMenu widget
public getMenuList ( integer $sub, mixed $parent ) : array
$sub integer levels
$parent mixed number, object or array of numbers
return array

getPath() public method

Constructs full path for current model
public getPath ( string $separator = '/' ) : string
$separator string
return string

getTabList() public method

..)
public getTabList ( mixed $parent ) : array
$parent mixed number, object or array of numbers
return array

getUrlList() public method

..)
public getUrlList ( mixed $parent ) : array
$parent mixed number, object or array of numbers
return array

isChildOf() public method

Checks for current model is child of parent
public isChildOf ( mixed $parent ) : boolean
$parent mixed number, object or array of numbers
return boolean

processParents() protected method

protected processParents ( $parent ) : array
$parent
return array

Property Details

$parentAttribute public_oe property

model attribute
public $parentAttribute

$parentRelation public_oe property

model parent BELONGS_TO relation
public $parentRelation

$statAttribute public_oe property

Stat relation name (defined in defaultCriteria)
public $statAttribute