Class Tree
Tree operations model
- Model
- AppModel
- BEAppModel
- Tree
Methods summary
public
|
|
public
boolean
|
#
isUniqueSection( array $check )
Custom validation rule to verify that a branch node (section, publication) is not already on the tree. A section must stay only in one tree node. |
public
boolean
|
|
public
mixed integer,
|
|
public
array,
|
#
getParents( integer|null $id = null, integer|null $area_id = null, array $status = array(), boolean $useCache = true )
Array of object $id tree parents objects |
public
|
#
updateTree( integer $id, array|integer $destination, array $options = array() )
Update tree position of object $id with new $destination array |
public
integer
|
|
public
boolean
|
#
appendChild( integer $id, integer|null $idParent = null, integer|null $priority = null )
Append an object to a parent. |
protected
boolean
|
#
appendChildWorker( integer $id, integer $idParent = null, integer $priority = null )
append an object to a parent in tree |
public
integer
|
|
public
boolean
|
#
movePriority( integer $id, integer $idParent, boolean $up = true )
move up or down a leaf tree inside a branch |
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
protected
boolean
|
|
public
boolean
|
|
public
integer
|
|
public
boolean
|
|
public
array
|
#
getAllRoots( integer $userid = null, mixed $status = null, array $filter = array(), array $expandBranch = array() )
get all tree roots objects (publications) |
public
array
|
|
public
array
|
|
private
|
#
putBranchInTree( array & $tree, array $branch )
search where have to stay $branch in $tree and put in |
public
boolean
|
|
public
array
|
#
titlesPaths( integer $id, array $hiddenBranchIds = array() )
Titles paths for branches related to $id passed Returns array, each element is like: [ { 'ids' => [223481, 274603], // array of integers 'parentId' => 274603, // integer parent id 'idsPath' => '/223481/274603', // string representing ids path 'titles' => [ 223481 => 'Publication A', // publication title 274603 => 'Section B' // section title ], 'titlesPath' => 'Publication A > Section B' // string that concats titles },, // ... ] |
public
boolean
|
|
public
array|integer
|
#
relatedObjectsOnTree( integer $id, array $options = array() )
Return a list of a count (based on $option['count']) of related object to $id that are on tree |
public
array
|
#
getChildren( integer $id = null, string $userid = null, string $status = null, array $filter = array(), string $order = null, boolean $dir = true, integer $page = 1, integer $dim = null, array $excludeIds = array() )
Children of id element (only 1 level in tree). If userid != null, only objects with read permissione for user, if ' ' - use guest/anonymous user, if userid = null -> no permission check. Filter: object types, search text query. |
public
array
|
#
getDescendants( integer $id = null, string $userid = null, string $status = null, array $filter = array(), string $order = null, boolean $dir = true, integer $page = 1, integer $dim = null, array $excludeIds = array() )
Descendants of id element (all elements in tree). (see: BEObject->find(), to search not using content tree ). If userid present, only objects with read permissione, if ' ' - guest/anonymous user, if userid = null -> no permission check. Filter: object types, search text query. |
public
|
#
saveMenuVisibility( mixed $ids, integer $parent_id, mixed $menu = null )
save Tree.menu field to set menu and canonical path visibility |
public
array,
|
#
cloneStructure( integer $id, array $options = array() )
Clone a tree structure Clone Publication and sections and add related contents |
public
|
#
copyContentsToBranch( integer $originalBranchId, integer $newBranchId )
copy contents from a branch to another brnach |
public
array
|
#
countUbiquity( array $objects, array $options = array() )
Add to array of BEdita objects a count of ubiquity |
public
|
|
public
boolean
|
#
removeTree( integer $id )
Removes a full tree that originates from the element with passed |
public
integer
|
#
countChildrenContents( integer $parentId, array $options = array() )
Count children using $options if any $options can contain every params used to customize Model::find() |
public
integer
|
#
countChildrenSections( integer $parentId, array $options = array() )
Count children using $options if any $options can contain every params used to customize Model::find() |
public
integer
|
#
countChildren( integer $parentId, array $options = array() )
Count children using $options if any $options can contain every params used to customize Model::find() |
public
array
|
|
protected
|
#
dispatchUpdatedTreeEvent( integer $id, string $eventType )
Dispatch event to notify that tree has been updated for an object. |
Methods inherited from BEAppModel
am()
,
buildQueryStatement()
,
checkDate()
,
checkDuration()
,
checkFloat()
,
checkNumber()
,
containLevel()
,
email()
,
fieldsString()
,
findObjects()
,
findObjectsAfterFilter()
,
findObjectsClauses()
,
findObjectsCount()
,
getBindingsLevel()
,
getDefaultDateFormat()
,
getDriver()
,
getEndQuote()
,
getLimitClausole()
,
getStartQuote()
,
setBindingsLevel()
,
setupDbParams()
,
toolbar()
Methods inherited from AppModel
Constants summary
string |
EVENT_PARENTS_UPDATED
Name of event dispatched when an object's parents are updated. |
#
'Tree.parentsUpdated'
|
string |
EVENT_CHILDREN_UPDATED
Name of event dispatched when a node's children are updated. |
#
'Tree.childrenUpdated'
|
Properties summary
public
string
|
$primaryKey
|
#
"object_path"
|
protected
|
$BeObjectCache
Object cache |
#
null
|
public
array
|
$validate
|
#
array(
'id' => array(
'rule' => 'isUniqueSection',
'message' => 'Ubiquitous sections/publications are not allowed',
),
)
|