Bitrix API

NodeRepository

Table of Contents

Constants

NODE_CACHE_KEY  = 'structure/node/%d'
NODE_ENTITY_CACHE_KEY  = 'structure/node/entity/%d'
NODE_ENTITY_RESTRICTION_CACHE  = 'structure/node/restriction'

Methods

create()  : Node
deleteById()  : void
Delete a node and all associated data from the database.
findAllByAccessCodes()  : NodeCollection
findAllByIds()  : NodeCollection
findAllByUserId()  : NodeCollection
findAllByUserIdAndRoleId()  : NodeCollection
findAllByXmlId()  : NodeCollection
getAllByStructureId()  : NodeCollection
getAllChildIdsByNodeId()  : array<int, int>
Retrieves all child ids of a given node id.
getAllPagedByStructureId()  : NodeCollection
getByAccessCode()  : Node|null
Retrieve a node by access code.
getById()  : Node|null
getByIdWithDepth()  : Node|null
returns node data with depth level
getChildOf()  : NodeCollection
getChildOfNodeCollection()  : NodeCollection
getNodesByName()  : NodeCollection
getParentOf()  : NodeCollection
getRootNodeByStructureId()  : Node|null
Retrieves the root node by structure id.
hasChild()  : bool
isAncestor()  : bool
update()  : Node

Constants

NODE_CACHE_KEY

public mixed NODE_CACHE_KEY = 'structure/node/%d'

NODE_ENTITY_CACHE_KEY

public mixed NODE_ENTITY_CACHE_KEY = 'structure/node/entity/%d'

NODE_ENTITY_RESTRICTION_CACHE

public mixed NODE_ENTITY_RESTRICTION_CACHE = 'structure/node/restriction'

Methods

deleteById()

Delete a node and all associated data from the database.

public deleteById(int $nodeId) : void
Parameters
$nodeId : int
Tags
throws
ArgumentException
throws
SystemException
throws
ObjectPropertyException

findAllByAccessCodes()

public findAllByAccessCodes(array<int, int> $departments) : NodeCollection
Parameters
$departments : array<int, int>
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
NodeCollection

findAllByIds()

public findAllByIds(array<string|int, mixed> $departmentIds[, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
$departmentIds : array<string|int, mixed>
$activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Tags
throws
ObjectPropertyException
throws
SystemException
throws
ArgumentException
Return values
NodeCollection

findAllByXmlId()

public findAllByXmlId(string $xmlId[, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
$xmlId : string

The XML ID of the nodes to find

$activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
NodeCollection

The collection of nodes found

getAllChildIdsByNodeId()

Retrieves all child ids of a given node id.

public getAllChildIdsByNodeId(int $nodeId) : array<int, int>
Parameters
$nodeId : int
Return values
array<int, int>

getAllPagedByStructureId()

public getAllPagedByStructureId(int $structureId[, int $limit = 10 ][, int $offset = 0 ][, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
$structureId : int
$limit : int = 10
$offset : int = 0
$activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Return values
NodeCollection

getByAccessCode()

Retrieve a node by access code.

public getByAccessCode(string $accessCode) : Node|null
Parameters
$accessCode : string

The access code of the node.

Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Node|null

The node with the given access code, or null if not found.

getById()

public getById(int $nodeId[, bool $needDepth = false ]) : Node|null
Parameters
$nodeId : int
$needDepth : bool = false
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Node|null

getByIdWithDepth()

returns node data with depth level

public getByIdWithDepth(int $nodeId) : Node|null
Parameters
$nodeId : int
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Node|null

getNodesByName()

public getNodesByName(int $structureId, string|null $name[, int|null $limit = 100 ][, int|null $parentId = null ][, DepthLevel|int $depth = DepthLevel::FULL ][, bool $strict = false ][, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
$structureId : int
$name : string|null
$limit : int|null = 100
$parentId : int|null = null
$depth : DepthLevel|int = DepthLevel::FULL
$strict : bool = false
$activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Return values
NodeCollection

getRootNodeByStructureId()

Retrieves the root node by structure id.

public getRootNodeByStructureId(int $structureId) : Node|null
Parameters
$structureId : int
Tags
throws
ObjectPropertyException
throws
ArgumentException
throws
WrongStructureItemException
throws
SystemException
Return values
Node|null

update()

public update(Node $node) : Node
Parameters
$node : Node
Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Node

        
On this page

Search results