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 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)
{
}
| 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();
}
| public void clear ( ) |
public function clear(): void
{
$this->storage->clear();
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}
| 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);
}
| 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);
}
| 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);
}
| public array getAll ( ) |
public function getAll(): array
{
$this->load();
return $this->storage->getAll();
}
| public array getByItemNames ( array $itemNames ) | ||
| $itemNames | array | |
public function getByItemNames(array $itemNames): array
{
$this->load();
return $this->storage->getByItemNames($itemNames);
}
| public array getByUserId ( string $userId ) | ||
| $userId | string | |
public function getByUserId(string $userId): array
{
$this->load();
return $this->storage->getByUserId($userId);
}
| public integer getFileUpdatedAt ( ) |
public function getFileUpdatedAt(): int
{
return $this->storage->getFileUpdatedAt();
}
| public boolean hasItem ( string $name ) | ||
| $name | string | |
public function hasItem(string $name): bool
{
$this->load();
return $this->storage->hasItem($name);
}
| 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();
}
| public void removeByItemName ( string $itemName ) | ||
| $itemName | string | |
public function removeByItemName(string $itemName): void
{
$this->load();
$this->storage->removeByItemName($itemName);
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}
| public void removeByUserId ( string $userId ) | ||
| $userId | string | |
public function removeByUserId(string $userId): void
{
$this->load();
$this->storage->removeByUserId($userId);
$this->currentFileUpdatedAt = $this->getFileUpdatedAt();
}
| 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();
}
Signup or Login in order to comment.