Trait kartik\tree\models\TreeTrait

Implemented bydmstr\modules\pages\models\Tree, kartik\tree\models\Tree

Trait that must be used by the Tree model

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$boolAttribs array The list of boolean value attributes kartik\tree\models\TreeTrait
$falseAttribs array The default list of boolean attributes with initial value = false kartik\tree\models\TreeTrait

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
parse() Parses an attribute value if set - else returns the default kartik\tree\models\TreeTrait
setDefault() Sets default value of a model attribute kartik\tree\models\TreeTrait

Property Details

$boolAttribs public static property

The list of boolean value attributes

public static array $boolAttribs = ['active''selected''disabled''readonly''visible''collapsed''movable_u''movable_d''movable_r''movable_l''removable''removable_all']
$falseAttribs public static property

The default list of boolean attributes with initial value = false

public static array $falseAttribs = ['selected''disabled''readonly''collapsed''removable_all']

Method Details

activateNode() public method

Activates a node (for undoing a soft deletion scenario)

public bool activateNode ( $currNode true )
$currNode bool

Whether to update the current node value also

return bool

Status of activation

attributeLabels() public method

public void attributeLabels ( )
behaviors() public method

public void behaviors ( )
createQuery() public static method

public static void createQuery ( )
find() public static method

public static void find ( )
getBreadcrumbs() public method

Generate and return the breadcrumbs for the node

public string getBreadcrumbs ( $depth 1, $glue ' » ', $currNodeCss 'kv-crumb-active', $untitled 'Untitled' )
$depth int

The breadcrumbs parent depth

$glue string

The pattern to separate the breadcrumbs

$currNodeCss string

The CSS class to be set for current node

$untitled string

The name to be displayed for a new node

return string

The parsed breadcrumbs

initDefaults() public method

Initialize default values

public void initDefaults ( )
isActive() public method

Validate if the node is active

public bool isActive ( )
isCollapsed() public method

Validate if the node is collapsed

public bool isCollapsed ( )
isDisabled() public method

Validate if the node is disabled

public bool isDisabled ( )
isMovable() public method

Validate if the node is movable

public bool isMovable ( $dir )
$dir string

The direction, one of 'u', 'd', 'l', or 'r'

isReadonly() public method

Validate if the node is readonly

public bool isReadonly ( )
isRemovable() public method

Validate if the node is removable

public bool isRemovable ( )
isRemovableAll() public method

Validate if the node is removable with descendants

public bool isRemovableAll ( )
isSelected() public method

Validate if the node is selected

public bool isSelected ( )
isVisible() public method

Validate if the node is visible

public bool isVisible ( )
parse() protected method

Parses an attribute value if set - else returns the default

protected mixed parse ( $attr, $default true )
$attr string

The attribute name

$default mixed

The attribute default value

removeNode() public method

Removes a node

public bool removeNode ( $softDelete true, $currNode true )
$softDelete bool

Whether to soft delete or hard delete

$currNode bool

Whether to update the current node value also

return bool

Status of activation/inactivation

rules() public method

public void rules ( )
setDefault() protected method

Sets default value of a model attribute

protected void setDefault ( $attr, $val )
$attr string

The attribute name

$val mixed

The default value

tableName() public static method

public static void tableName ( )
transactions() public method

public void transactions ( )