0 follower

Final Class Yiisoft\Rbac\Php\ConcurrentAssignmentsStorageDecorator

InheritanceYiisoft\Rbac\Php\ConcurrentAssignmentsStorageDecorator
ImplementsYiisoft\Rbac\AssignmentsStorageInterface, Yiisoft\Rbac\Php\FileStorageInterface
Uses TraitsYiisoft\Rbac\Php\ConcurrentStorageTrait

Method Details

Hide inherited methods

__construct() public method

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

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

            
add() public method

public void add ( \Yiisoft\Rbac\Assignment $assignment )
$assignment \Yiisoft\Rbac\Assignment

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

            
clear() public method

public void clear ( )

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

            
exists() public method

public boolean exists ( string $itemName, string $userId )
$itemName string
$userId string

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

            
filterUserItemNames() public method

public array filterUserItemNames ( string $userId, array $itemNames )
$userId string
$itemNames array

                public function filterUserItemNames(string $userId, array $itemNames): array
{
    $this->load();
    return $this->storage->filterUserItemNames($userId, $itemNames);
}

            
get() public method

public \Yiisoft\Rbac\Assignment|null get ( string $itemName, string $userId )
$itemName string
$userId string

                public function get(string $itemName, string $userId): ?Assignment
{
    $this->load();
    return $this->storage->get($itemName, $userId);
}

            
getAll() public method

public array getAll ( )

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

            
getByItemNames() public method

public array getByItemNames ( array $itemNames )
$itemNames array

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

            
getByUserId() public method

public array getByUserId ( string $userId )
$userId string

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

            
getFileUpdatedAt() public method
public integer getFileUpdatedAt ( )

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

            
hasItem() public method

public boolean hasItem ( string $name )
$name string

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

            
load() public method

public void load ( )

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

            
remove() public method

public void remove ( string $itemName, string $userId )
$itemName string
$userId string

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

            
removeByItemName() public method

public void removeByItemName ( string $itemName )
$itemName string

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

            
removeByUserId() public method

public void removeByUserId ( string $userId )
$userId string

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

            
renameItem() public method

public void renameItem ( string $oldName, string $newName )
$oldName string
$newName string

                public function renameItem(string $oldName, string $newName): void
{
    $this->load();
    $this->storage->renameItem($oldName, $newName);
    $this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}

            
userHasItem() public method

public boolean userHasItem ( string $userId, array $itemNames )
$userId string
$itemNames array

                public function userHasItem(string $userId, array $itemNames): bool
{
    $this->load();
    return $this->storage->userHasItem($userId, $itemNames);
}