UserRole
in package
uses
IdentifiableTrait
User role model.
This specifies all the roles of a user.
Tags
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|nullgetId()
Get the identifier of the object.
public
getId() : int|null
Tags
Return values
int|nullgetLidnr()
Get the membership number.
public
getLidnr() : User
Return values
UsergetRole()
Get the role.
public
getRole() : UserRoles
Return values
UserRolesisActive()
Determine whether this role is active (i.e. has not expired).
public
isActive() : bool
Return values
boolsetExpiration()
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
setRole()
Set the role.
public
setRole(UserRoles $role) : void
Parameters
- $role : UserRoles
toGdprArray()
public
toGdprArray() : UserRoleGdprArrayType