PermissionRestrictedNodeRepository extends NodeRepository
FinalYes
Table of Contents
Methods
- __construct() : mixed
- 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
- Get child nodes of a node collection.
- getNodesByName() : NodeCollection
- getParentOf() : NodeCollection
- getRootNodeByStructureId() : Node|null
- Retrieves the root node by structure id.
- hasChild() : bool
- isAncestor() : bool
- mapItemToModel() : Node
- update() : Node
Methods
__construct()
public
__construct() : mixed
Tags
create()
public
create(Node $node) : Node
Parameters
- $node : Node
Tags
Return values
NodedeleteById()
Delete a node and all associated data from the database.
public
deleteById(int $nodeId) : void
Parameters
- $nodeId : int
Tags
findAllByAccessCodes()
public
findAllByAccessCodes(array<int, int> $departments) : NodeCollection
Parameters
- $departments : array<int, int>
Tags
Return values
NodeCollectionfindAllByIds()
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
Return values
NodeCollectionfindAllByUserId()
public
findAllByUserId(int $userId[, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
- $userId : int
- $activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Tags
Return values
NodeCollectionfindAllByUserIdAndRoleId()
public
findAllByUserIdAndRoleId(int $userId, int $roleId[, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
- $userId : int
- $roleId : int
- $activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Return values
NodeCollectionfindAllByXmlId()
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
Return values
NodeCollection —The collection of nodes found
getAllByStructureId()
public
getAllByStructureId(int $structureId[, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
- $structureId : int
- $activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Return values
NodeCollectiongetAllChildIdsByNodeId()
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
NodeCollectiongetByAccessCode()
Retrieve a node by access code.
public
getByAccessCode(string $accessCode) : Node|null
Parameters
- $accessCode : string
-
The access code of the node.
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
Return values
Node|nullgetByIdWithDepth()
returns node data with depth level
public
getByIdWithDepth(int $nodeId) : Node|null
Parameters
- $nodeId : int
Tags
Return values
Node|nullgetChildOf()
public
getChildOf(Node $node[, DepthLevel|int $depthLevel = DepthLevel::FIRST ][, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
- $node : Node
- $depthLevel : DepthLevel|int = DepthLevel::FIRST
- $activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Return values
NodeCollectiongetChildOfNodeCollection()
Get child nodes of a node collection.
public
getChildOfNodeCollection(NodeCollection $nodeCollection[, DepthLevel|int $depthLevel = DepthLevel::FIRST ][, NodeActiveFilter $activeFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE ]) : NodeCollection
Parameters
- $nodeCollection : NodeCollection
-
The parent node collection.
- $depthLevel : DepthLevel|int = DepthLevel::FIRST
-
[optional] The depth level of child nodes. Default is DepthLevel::FIRST.
- $activeFilter : NodeActiveFilter = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Return values
NodeCollection —The child node collection.
getNodesByName()
public
getNodesByName(int $structureId, string|null $name[, int|null $limit = 100 ][, int|null $parentId = null ][, DepthLevel|int $depth = DepthLevel::FULL ][, bool $strict = false ][, mixed $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 : mixed = NodeActiveFilter::ONLY_GLOBAL_ACTIVE
Return values
NodeCollectiongetParentOf()
public
getParentOf(Node $node[, DepthLevel|int $depthLevel = DepthLevel::FIRST ]) : NodeCollection
Parameters
- $node : Node
- $depthLevel : DepthLevel|int = DepthLevel::FIRST
Tags
Return values
NodeCollectiongetRootNodeByStructureId()
Retrieves the root node by structure id.
public
getRootNodeByStructureId(int $structureId) : Node|null
Parameters
- $structureId : int
Tags
Return values
Node|nullhasChild()
public
hasChild(Node $node) : bool
Parameters
- $node : Node
Return values
boolisAncestor()
public
isAncestor(Node $node, Node $targetNode) : bool
Parameters
Return values
boolmapItemToModel()
public
mapItemToModel(Node $nodeEntity, Node $node) : Node
Parameters
Return values
Nodeupdate()
public
update(Node $node) : Node
Parameters
- $node : Node