Documentation

UserRole
in package
uses IdentifiableTrait

User role model.

This specifies all the roles of a user.

Tags
psalm-type

UserRoleGdprArrayType = array{ role: string, expiration: ?string, }

Attributes
#[Entity]

Table of Contents

Properties

$expiration  : DateTime|null
Date after which this role has expired.
$id  : int|null
The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
$lidnr  : User
The membership number of the user with this role.
$role  : UserRoles
The user's role.

Methods

getExpiration()  : DateTime|null
Get the expiration, `null` means invalid (and thus inactive).
getId()  : int|null
Get the identifier of the object.
getLidnr()  : User
Get the membership number.
getRole()  : UserRoles
Get the role.
isActive()  : bool
Determine whether this role is active (i.e. has not expired).
setExpiration()  : void
Set the expiration date.
setId()  : void
Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
setLidnr()  : void
Set the membership number.
setRole()  : void
Set the role.
toGdprArray()  : UserRoleGdprArrayType

Properties

$expiration

Date after which this role has expired.

protected DateTime|null $expiration = null
Attributes
#[Column]
$type: 'datetime'
$nullable: true

$id

The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.

protected int|null $id = null
Attributes
#[Column]
$type: 'integer'
#[GeneratedValue]
$strategy: 'IDENTITY'
#[Id]

$lidnr

The membership number of the user with this role.

protected User $lidnr
Attributes
#[JoinColumn]
$referencedColumnName: 'lidnr'
$nullable: false
#[ManyToOne]
$targetEntity: \User\Model\User::class
$inversedBy: 'roles'

$role

The user's role.

protected UserRoles $role
Attributes
#[Column]
$type: 'string'
$enumType: \User\Model\Enums\UserRoles::class

Methods

getExpiration()

Get the expiration, `null` means invalid (and thus inactive).

public getExpiration() : DateTime|null
Return values
DateTime|null

getId()

Get the identifier of the object.

public getId() : int|null
Tags
psalm-ignore-nullable-return
Return values
int|null

getLidnr()

Get the membership number.

public getLidnr() : User
Return values
User

isActive()

Determine whether this role is active (i.e. has not expired).

public isActive() : bool
Return values
bool

setExpiration()

Set the expiration date.

public setExpiration(DateTime $expiration) : void
Parameters
$expiration : DateTime

setId()

Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!

public setId(int|null $id) : void
Parameters
$id : int|null

setLidnr()

Set the membership number.

public setLidnr(User $lidnr) : void
Parameters
$lidnr : User

toGdprArray()

public toGdprArray() : UserRoleGdprArrayType
Return values
UserRoleGdprArrayType

        
On this page

Search results