0 follower

Final Class Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator

InheritanceYiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
ImplementsYiisoft\Rbac\ItemsStorageInterface, Yiisoft\Rbac\Php\FileStorageInterface
Uses TraitsYiisoft\Rbac\Php\ConcurrentStorageTrait

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
add() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
addChild() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
clear() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
clearPermissions() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
clearRoles() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
exists() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
get() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getAll() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getAllChildPermissions() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getAllChildRoles() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getAllChildren() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getByNames() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getDirectChildren() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getFileUpdatedAt() Yiisoft\Rbac\Php\ConcurrentStorageTrait
getHierarchy() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getParents() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getPermission() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getPermissions() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getPermissionsByNames() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getRole() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getRoles() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
getRolesByNames() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
hasChild() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
hasChildren() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
hasDirectChild() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
load() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
remove() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
removeChild() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
removeChildren() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
roleExists() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator
update() Yiisoft\Rbac\Php\ConcurrentItemsStorageDecorator

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Rbac\Php\FileStorageInterface&\Yiisoft\Rbac\ItemsStorageInterface $storage )
$storage Yiisoft\Rbac\Php\FileStorageInterface&\Yiisoft\Rbac\ItemsStorageInterface

                public function __construct(private ItemsStorageInterface|FileStorageInterface $storage)
{
}

            
add() public method

public void add ( \Yiisoft\Rbac\Permission|\Yiisoft\Rbac\Role $item )
$item \Yiisoft\Rbac\Permission|\Yiisoft\Rbac\Role

                public function add(Permission|Role $item): void
{
    $this->load();
    $this->storage->add($item);
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
addChild() public method

public void addChild ( string $parentName, string $childName )
$parentName string
$childName string

                public function addChild(string $parentName, string $childName): void
{
    $this->load();
    $this->storage->addChild($parentName, $childName);
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
clear() public method

public void clear ( )

                public function clear(): void
{
    $this->storage->clear();
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
clearPermissions() public method

public void clearPermissions ( )

                public function clearPermissions(): void
{
    $this->load();
    $this->storage->clearPermissions();
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
clearRoles() public method

public void clearRoles ( )

                public function clearRoles(): void
{
    $this->load();
    $this->storage->clearRoles();
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
exists() public method

public boolean exists ( string $name )
$name string

                public function exists(string $name): bool
{
    $this->load();
    return $this->storage->exists($name);
}

            
get() public method

public \Yiisoft\Rbac\Permission|\Yiisoft\Rbac\Role|null get ( string $name )
$name string

                public function get(string $name): Permission|Role|null
{
    $this->load();
    return $this->storage->get($name);
}

            
getAll() public method

public array getAll ( )

                public function getAll(): array
{
    $this->load();
    return $this->storage->getAll();
}

            
getAllChildPermissions() public method

public array getAllChildPermissions ( string|array $names )
$names string|array

                public function getAllChildPermissions(string|array $names): array
{
    $this->load();
    return $this->storage->getAllChildPermissions($names);
}

            
getAllChildRoles() public method

public array getAllChildRoles ( string|array $names )
$names string|array

                public function getAllChildRoles(string|array $names): array
{
    $this->load();
    return $this->storage->getAllChildRoles($names);
}

            
getAllChildren() public method

public array getAllChildren ( string|array $names )
$names string|array

                public function getAllChildren(string|array $names): array
{
    $this->load();
    return $this->storage->getAllChildren($names);
}

            
getByNames() public method

public array getByNames ( array $names )
$names array

                public function getByNames(array $names): array
{
    $this->load();
    return $this->storage->getByNames($names);
}

            
getDirectChildren() public method

public array getDirectChildren ( string $name )
$name string

                public function getDirectChildren(string $name): array
{
    $this->load();
    return $this->storage->getDirectChildren($name);
}

            
getFileUpdatedAt() public method
public integer getFileUpdatedAt ( )

                public function getFileUpdatedAt(): int
{
    return $this->storage->getFileUpdatedAt();
}

            
getHierarchy() public method

public array getHierarchy ( string $name )
$name string

                public function getHierarchy(string $name): array
{
    $this->load();
    return $this->storage->getHierarchy($name);
}

            
getParents() public method

public array getParents ( string $name )
$name string

                public function getParents(string $name): array
{
    $this->load();
    return $this->storage->getParents($name);
}

            
getPermission() public method

public \Yiisoft\Rbac\Permission|null getPermission ( string $name )
$name string

                public function getPermission(string $name): ?Permission
{
    $this->load();
    return $this->storage->getPermission($name);
}

            
getPermissions() public method

public array getPermissions ( )

                public function getPermissions(): array
{
    $this->load();
    return $this->storage->getPermissions();
}

            
getPermissionsByNames() public method

public array getPermissionsByNames ( array $names )
$names array

                public function getPermissionsByNames(array $names): array
{
    $this->load();
    return $this->storage->getPermissionsByNames($names);
}

            
getRole() public method

public \Yiisoft\Rbac\Role|null getRole ( string $name )
$name string

                public function getRole(string $name): ?Role
{
    $this->load();
    return $this->storage->getRole($name);
}

            
getRoles() public method

public array getRoles ( )

                public function getRoles(): array
{
    $this->load();
    return $this->storage->getRoles();
}

            
getRolesByNames() public method

public array getRolesByNames ( array $names )
$names array

                public function getRolesByNames(array $names): array
{
    $this->load();
    return $this->storage->getRolesByNames($names);
}

            
hasChild() public method

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

                public function hasChild(string $parentName, string $childName): bool
{
    $this->load();
    return $this->storage->hasChild($parentName, $childName);
}

            
hasChildren() public method

public boolean hasChildren ( string $name )
$name string

                public function hasChildren(string $name): bool
{
    $this->load();
    return $this->storage->hasChildren($name);
}

            
hasDirectChild() public method

public boolean hasDirectChild ( string $parentName, string $childName )
$parentName string
$childName string

                public function hasDirectChild(string $parentName, string $childName): bool
{
    $this->load();
    return $this->storage->hasDirectChild($parentName, $childName);
}

            
load() public method

public void load ( )

                public function load(): void
{
    $this->loadInternal($this->storage);
}

            
remove() public method

public void remove ( string $name )
$name string

                public function remove(string $name): void
{
    $this->load();
    $this->storage->remove($name);
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
removeChild() public method

public void removeChild ( string $parentName, string $childName )
$parentName string
$childName string

                public function removeChild(string $parentName, string $childName): void
{
    $this->load();
    $this->storage->removeChild($parentName, $childName);
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
removeChildren() public method

public void removeChildren ( string $parentName )
$parentName string

                public function removeChildren(string $parentName): void
{
    $this->load();
    $this->storage->removeChildren($parentName);
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
roleExists() public method

public boolean roleExists ( string $name )
$name string

                public function roleExists(string $name): bool
{
    $this->load();
    return $this->storage->roleExists($name);
}

            
update() public method

public void update ( string $name, \Yiisoft\Rbac\Permission|\Yiisoft\Rbac\Role $item )
$name string
$item \Yiisoft\Rbac\Permission|\Yiisoft\Rbac\Role

                public function update(string $name, Permission|Role $item): void
{
    $this->load();
    $this->storage->update($name, $item);
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}