Final Class Yiisoft\Rbac\Php\ConcurrentAssignmentsStorageDecorator
| Inheritance | Yiisoft\Rbac\Php\ConcurrentAssignmentsStorageDecorator |
|---|---|
| Implements | Yiisoft\Rbac\AssignmentsStorageInterface, Yiisoft\Rbac\Php\FileStorageInterface |
| Uses Traits | Yiisoft\Rbac\Php\ConcurrentStorageTrait |
Public Methods
Method Details
| 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)
{
}
| 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();
}
| public clear( ): void |
public function clear(): void
{
$this->storage->clear();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}
| 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);
}
| 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);
}
| 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);
}
| public getAll( ): array |
public function getAll(): array
{
$this->load();
return $this->storage->getAll();
}
| public getByItemNames( array $itemNames ): array | ||
| $itemNames | array | |
public function getByItemNames(array $itemNames): array
{
$this->load();
return $this->storage->getByItemNames($itemNames);
}
| public getByUserId( string $userId ): array | ||
| $userId | string | |
public function getByUserId(string $userId): array
{
$this->load();
return $this->storage->getByUserId($userId);
}
| public getFileUpdatedAt( ): integer |
public function getFileUpdatedAt(): int
{
return $this->storage->getFileUpdatedAt();
}
| public hasItem( string $name ): boolean | ||
| $name | string | |
public function hasItem(string $name): bool
{
$this->load();
return $this->storage->hasItem($name);
}
| 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();
}
| public removeByItemName( string $itemName ): void | ||
| $itemName | string | |
public function removeByItemName(string $itemName): void
{
$this->load();
$this->storage->removeByItemName($itemName);
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}
| public removeByUserId( string $userId ): void | ||
| $userId | string | |
public function removeByUserId(string $userId): void
{
$this->load();
$this->storage->removeByUserId($userId);
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}
| 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();
}
Signup or Login in order to comment.