0 follower

Final Class Yiisoft\Rbac\Role

InheritanceYiisoft\Rbac\Role » Yiisoft\Rbac\Item

Constants

Hide inherited constants

Constant Value Description Defined By
TYPE_PERMISSION 'permission' Yiisoft\Rbac\Item
TYPE_ROLE 'role' Yiisoft\Rbac\Item

Method Details

Hide inherited methods

__construct() public method
public __construct( string $name ): mixed
$name string

The name of the item. This must be globally unique.

                final public function __construct(private string $name) {}

            
getAttributes() public method
public getAttributes( ): array
return array

Attribute values indexed by corresponding names.

                final public function getAttributes(): array
{
    return [
        'name' => $this->getName(),
        'description' => $this->getDescription(),
        'rule_name' => $this->getRuleName(),
        'type' => $this->getType(),
        'updated_at' => $this->getUpdatedAt(),
        'created_at' => $this->getCreatedAt(),
    ];
}

            
getCreatedAt() public method
public getCreatedAt( ): integer|null

                final public function getCreatedAt(): ?int
{
    return $this->createdAt;
}

            
getDescription() public method
public getDescription( ): string

                final public function getDescription(): string
{
    return $this->description;
}

            
getName() public method
public getName( ): string
return string

Authorization item name.

                final public function getName(): string
{
    return $this->name;
}

            
getRuleName() public method
public getRuleName( ): string|null

                final public function getRuleName(): ?string
{
    return $this->ruleName;
}

            
getType() public method

public getType( ): string

                public function getType(): string
{
    return self::TYPE_ROLE;
}

            
getUpdatedAt() public method
public getUpdatedAt( ): integer|null

                final public function getUpdatedAt(): ?int
{
    return $this->updatedAt;
}

            
hasCreatedAt() public method
public hasCreatedAt( ): boolean

                final public function hasCreatedAt(): bool
{
    return $this->createdAt !== null;
}

            
hasUpdatedAt() public method
public hasUpdatedAt( ): boolean

                final public function hasUpdatedAt(): bool
{
    return $this->updatedAt !== null;
}

            
withCreatedAt() public method
public withCreatedAt( integer $createdAt ): Yiisoft\Rbac\Role
$createdAt integer

                final public function withCreatedAt(int $createdAt): self
{
    $new = clone $this;
    $new->createdAt = $createdAt;
    return $new;
}

            
withDescription() public method
public withDescription( string $description ): Yiisoft\Rbac\Role
$description string

                final public function withDescription(string $description): self
{
    $new = clone $this;
    $new->description = $description;
    return $new;
}

            
withName() public method
public withName( string $name ): Yiisoft\Rbac\Role
$name string

                final public function withName(string $name): self
{
    $new = clone $this;
    $new->name = $name;
    return $new;
}

            
withRuleName() public method
public withRuleName( string|null $ruleName ): Yiisoft\Rbac\Role
$ruleName string|null

                final public function withRuleName(?string $ruleName): self
{
    $new = clone $this;
    $new->ruleName = $ruleName;
    return $new;
}

            
withUpdatedAt() public method
public withUpdatedAt( integer $updatedAt ): Yiisoft\Rbac\Role
$updatedAt integer

                final public function withUpdatedAt(int $updatedAt): self
{
    $new = clone $this;
    $new->updatedAt = $updatedAt;
    return $new;
}