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 __construct( \Yiisoft\Rbac\AssignmentsStorageInterface&Yiisoft\Rbac\Php\FileStorageInterface $storage ): mixed
$storage \Yiisoft\Rbac\AssignmentsStorageInterface&Yiisoft\Rbac\Php\FileStorageInterface

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

            
add() public method

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

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

            
clear() public method

public clear( ): void

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

            
exists() public method

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

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

            
filterUserItemNames() public method

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

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

            
get() public method

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

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

            
getAll() public method

public getAll( ): array

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

            
getByItemNames() public method

public getByItemNames( array $itemNames ): array
$itemNames array

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

            
getByUserId() public method

public getByUserId( string $userId ): array
$userId string

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

            
getFileUpdatedAt() public method
public getFileUpdatedAt( ): integer

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

            
hasItem() public method

public hasItem( string $name ): boolean
$name string

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

            
load() public method

public load( ): void

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

            
remove() public method

public remove( string $itemName, string $userId ): void
$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 removeByItemName( string $itemName ): void
$itemName string

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

            
removeByUserId() public method

public removeByUserId( string $userId ): void
$userId string

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

            
renameItem() public method

public renameItem( string $oldName, string $newName ): void
$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 userHasItem( string $userId, array $itemNames ): boolean
$userId string
$itemNames array

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