0 follower

Interface Yiisoft\Rbac\Cycle\ItemTreeTraversal\ItemTreeTraversalInterface

Implemented byYiisoft\Rbac\Cycle\ItemTreeTraversal\CteItemTreeTraversal, Yiisoft\Rbac\Cycle\ItemTreeTraversal\MysqlCteItemTreeTraversal, Yiisoft\Rbac\Cycle\ItemTreeTraversal\MysqlItemTreeTraversal, Yiisoft\Rbac\Cycle\ItemTreeTraversal\PostgresCteItemTreeTraversal, Yiisoft\Rbac\Cycle\ItemTreeTraversal\SqlServerCteItemTreeTraversal, Yiisoft\Rbac\Cycle\ItemTreeTraversal\SqliteCteItemTreeTraversal

An interface for retrieving hierarchical RBAC items' data in a more efficient way depending on used RDBMS and their versions.

Psalm Types

Name Value
Hierarchy non-empty-list<array{type: \Yiisoft\Rbac\Item::TYPE_*, name: string, description: string|null, rule_name: string|null, created_at: integer|string, updated_at: integer|string, children: string}>

Public Methods

Hide inherited methods

Method Description Defined By
getChildPermissionRows() Get all child permission rows for an item by the given name. Yiisoft\Rbac\Cycle\ItemTreeTraversal\ItemTreeTraversalInterface
getChildRoleRows() Get all child role rows for an item by the given name. Yiisoft\Rbac\Cycle\ItemTreeTraversal\ItemTreeTraversalInterface
getChildrenRows() Get all children rows for an item by the given name. Yiisoft\Rbac\Cycle\ItemTreeTraversal\ItemTreeTraversalInterface
getHierarchy() Returns the parents tree for a single item which additionally contains children for each parent (only among the found items). The base item is included too, its children list is always empty. Yiisoft\Rbac\Cycle\ItemTreeTraversal\ItemTreeTraversalInterface
getParentRows() Get all parent rows for an item by the given name. Yiisoft\Rbac\Cycle\ItemTreeTraversal\ItemTreeTraversalInterface
hasChild() Whether a selected parent has a specific child. Yiisoft\Rbac\Cycle\ItemTreeTraversal\ItemTreeTraversalInterface

Method Details

Hide inherited methods

getChildPermissionRows() public abstract method

Get all child permission rows for an item by the given name.

public abstract getChildPermissionRows( string|string[] $names ): array
$names string|string[]

Item name / names.

return array

Flat list of all child permissions.

                public function getChildPermissionRows(string|array $names): array;

            
getChildRoleRows() public abstract method

Get all child role rows for an item by the given name.

public abstract getChildRoleRows( string|string[] $names ): array
$names string|string[]

Item name / names.

return array

Flat list of all child roles.

                public function getChildRoleRows(string|array $names): array;

            
getChildrenRows() public abstract method

Get all children rows for an item by the given name.

public abstract getChildrenRows( string|string[] $names ): array
$names string|string[]

Item name / names.

return array

Flat list of all children.

                public function getChildrenRows(string|array $names): array;

            
getHierarchy() public abstract method

Returns the parents tree for a single item which additionally contains children for each parent (only among the found items). The base item is included too, its children list is always empty.

public abstract getHierarchy( string $name ): array
$name string

The child name.

                public function getHierarchy(string $name): array;

            
getParentRows() public abstract method

Get all parent rows for an item by the given name.

public abstract getParentRows( string $name ): array
$name string

Item name.

return array

Flat list of all parents.

                public function getParentRows(string $name): array;

            
hasChild() public abstract method

Whether a selected parent has a specific child.

public abstract hasChild( string $parentName, string $childName ): boolean
$parentName string

Parent item name.

$childName string

Child item name.

return boolean

Whether a selected parent has a specific child.

                public function hasChild(string $parentName, string $childName): bool;