PHP Class Phalcon\Mvc\Model\Behavior\NestedSet

Inheritance: extends Phalcon\Mvc\Model\Behavior, implements Phalcon\Mvc\Model\BehaviorInterface
Datei anzeigen Open project: phalcon/incubator

Public Methods

Method Description
__construct ( $options = null )
ancestors ( integer $depth = null ) : Phalcon\Mvc\Model\ResultsetInterface Named scope. Gets ancestors for node.
append ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean Appends target to node as last child.
appendTo ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean Appends node to target as last child.
children ( ) : Phalcon\Mvc\Model\ResultsetInterface Named scope. Gets children for node (direct descendants only).
deleteNode ( ) : boolean Deletes node and it's descendants.
descendants ( integer $depth = null, boolean $addSelf = false ) : Phalcon\Mvc\Model\ResultsetInterface Named scope. Gets descendants for node.
getIsDeletedRecord ( ) : boolean Returns if the current node is deleted.
getIsNewRecord ( )
getOwner ( ) : Phalcon\Mvc\ModelInterface
insertAfter ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean Inserts node as next sibling of target.
insertBefore ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean Inserts node as previous sibling of target.
isDescendantOf ( Phalcon\Mvc\ModelInterface $subj ) : boolean Determines if node is descendant of subject node.
isLeaf ( ) : boolean Determines if node is leaf.
isRoot ( ) : boolean Determines if node is root.
missingMethod ( Phalcon\Mvc\ModelInterface $model, string $method, null $arguments = null ) : mixed | null | string Calls a method when it's missing in the model
moveAfter ( Phalcon\Mvc\ModelInterface $target ) : boolean Move node as next sibling of target.
moveAsFirst ( Phalcon\Mvc\ModelInterface $target ) : boolean Move node as first child of target.
moveAsLast ( Phalcon\Mvc\ModelInterface $target ) : boolean Move node as last child of target.
moveAsRoot ( ) : boolean Move node as new root.
moveBefore ( Phalcon\Mvc\ModelInterface $target ) : boolean Move node as previous sibling of target.
next ( ) : Phalcon\Mvc\ModelInterface Named scope. Gets next sibling of node.
notify ( string $eventType, Phalcon\Mvc\ModelInterface $model )
parent ( ) : Phalcon\Mvc\ModelInterface Named scope. Gets parent of node.
prepend ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean Prepends target to node as first child.
prependTo ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean Prepends node to target as first child.
prev ( ) : Phalcon\Mvc\ModelInterface Named scope. Gets previous sibling of node.
roots ( ) : Phalcon\Mvc\Model\ResultsetInterface Named scope. Gets root node(s).
saveNode ( array $attributes = null, array $whiteList = null ) : boolean Create root node if multiple-root tree mode. Update node if it's not new.
setIsDeletedRecord ( boolean $value ) Sets if the current node is deleted.
setOwner ( Phalcon\Mvc\ModelInterface $owner )

Private Methods

Method Description
addNode ( Phalcon\Mvc\ModelInterface $target, integer $key, integer $levelUp, array $attributes = null ) : boolean
getDbHandler ( Phalcon\Mvc\ModelInterface $model ) : Phalcon\Db\AdapterInterface Gets DB handler.
makeRoot ( array $attributes, array $whiteList ) : boolean
moveNode ( Phalcon\Mvc\ModelInterface $target, integer $key, integer $levelUp ) : boolean
shiftLeftRight ( integer $key, integer $delta, Phalcon\Mvc\ModelInterface $model = null ) : boolean

Method Details

__construct() public method

public __construct ( $options = null )

ancestors() public method

Named scope. Gets ancestors for node.
public ancestors ( integer $depth = null ) : Phalcon\Mvc\Model\ResultsetInterface
$depth integer the depth.
return Phalcon\Mvc\Model\ResultsetInterface

append() public method

Appends target to node as last child.
public append ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
$attributes array list of attributes.
return boolean

appendTo() public method

Appends node to target as last child.
public appendTo ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
$attributes array list of attributes.
return boolean

children() public method

Named scope. Gets children for node (direct descendants only).
public children ( ) : Phalcon\Mvc\Model\ResultsetInterface
return Phalcon\Mvc\Model\ResultsetInterface

deleteNode() public method

Deletes node and it's descendants.
public deleteNode ( ) : boolean
return boolean

descendants() public method

Named scope. Gets descendants for node.
public descendants ( integer $depth = null, boolean $addSelf = false ) : Phalcon\Mvc\Model\ResultsetInterface
$depth integer the depth.
$addSelf boolean If TRUE - parent node will be added to result set.
return Phalcon\Mvc\Model\ResultsetInterface

getIsDeletedRecord() public method

Returns if the current node is deleted.
public getIsDeletedRecord ( ) : boolean
return boolean whether the node is deleted.

getIsNewRecord() public method

public getIsNewRecord ( )

getOwner() public method

public getOwner ( ) : Phalcon\Mvc\ModelInterface
return Phalcon\Mvc\ModelInterface

insertAfter() public method

Inserts node as next sibling of target.
public insertAfter ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
$attributes array list of attributes.
return boolean

insertBefore() public method

Inserts node as previous sibling of target.
public insertBefore ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
$attributes array list of attributes.
return boolean

isDescendantOf() public method

Determines if node is descendant of subject node.
public isDescendantOf ( Phalcon\Mvc\ModelInterface $subj ) : boolean
$subj Phalcon\Mvc\ModelInterface the subject node.
return boolean whether the node is descendant of subject node.

isLeaf() public method

Determines if node is leaf.
public isLeaf ( ) : boolean
return boolean whether the node is leaf.

isRoot() public method

Determines if node is root.
public isRoot ( ) : boolean
return boolean whether the node is root.

missingMethod() public method

Calls a method when it's missing in the model
public missingMethod ( Phalcon\Mvc\ModelInterface $model, string $method, null $arguments = null ) : mixed | null | string
$model Phalcon\Mvc\ModelInterface
$method string
$arguments null
return mixed | null | string

moveAfter() public method

Move node as next sibling of target.
public moveAfter ( Phalcon\Mvc\ModelInterface $target ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
return boolean

moveAsFirst() public method

Move node as first child of target.
public moveAsFirst ( Phalcon\Mvc\ModelInterface $target ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
return boolean

moveAsLast() public method

Move node as last child of target.
public moveAsLast ( Phalcon\Mvc\ModelInterface $target ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
return boolean

moveAsRoot() public method

Move node as new root.
public moveAsRoot ( ) : boolean
return boolean

moveBefore() public method

Move node as previous sibling of target.
public moveBefore ( Phalcon\Mvc\ModelInterface $target ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
return boolean

next() public method

Named scope. Gets next sibling of node.
public next ( ) : Phalcon\Mvc\ModelInterface
return Phalcon\Mvc\ModelInterface

notify() public method

public notify ( string $eventType, Phalcon\Mvc\ModelInterface $model )
$eventType string
$model Phalcon\Mvc\ModelInterface

parent() public method

Named scope. Gets parent of node.
public parent ( ) : Phalcon\Mvc\ModelInterface
return Phalcon\Mvc\ModelInterface

prepend() public method

Prepends target to node as first child.
public prepend ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean
$target Phalcon\Mvc\ModelInterface the target.
$attributes array list of attributes.
return boolean

prependTo() public method

Prepends node to target as first child.
public prependTo ( Phalcon\Mvc\ModelInterface $target, array $attributes = null ) : boolean
$target Phalcon\Mvc\ModelInterface the target
$attributes array List of attributes.
return boolean

prev() public method

Named scope. Gets previous sibling of node.
public prev ( ) : Phalcon\Mvc\ModelInterface
return Phalcon\Mvc\ModelInterface

roots() public method

Named scope. Gets root node(s).
public roots ( ) : Phalcon\Mvc\Model\ResultsetInterface
return Phalcon\Mvc\Model\ResultsetInterface

saveNode() public method

Create root node if multiple-root tree mode. Update node if it's not new.
public saveNode ( array $attributes = null, array $whiteList = null ) : boolean
$attributes array list of attributes.
$whiteList array whether to perform validation.
return boolean

setIsDeletedRecord() public method

Sets if the current node is deleted.
public setIsDeletedRecord ( boolean $value )
$value boolean whether the node is deleted.

setOwner() public method

public setOwner ( Phalcon\Mvc\ModelInterface $owner )
$owner Phalcon\Mvc\ModelInterface