Module
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait
AbstractYes
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'module'
Table of Contents
Interfaces
- IdentifiableInterface
- Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).
Properties
- $activated : bool
- $id : int|null
- $name : string
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getActivated() : bool
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getId() : int|null
- getName() : string
- isActivated() : bool
- isPersisted() : bool
- setActivated() : $this
- setId() : $this
- setName() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$activated
protected
bool
$activated
= true
Attributes
- #[Column]
- $name: 'activated'
- $type: 'boolean'
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'module_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$name
protected
string
$name
= ''
Attributes
- #[Column]
- $name: 'name'
- $type: 'string'
- $length: 45
Methods
__construct()
public
__construct([int|null $id = null ][, string $name = '' ][, bool $activated = true ]) : mixed
Parameters
- $id : int|null = null
- $name : string = ''
- $activated : bool = true
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getActivated()
public
getActivated() : bool
Return values
boolgetAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getId()
public
getId() : int|null
Return values
int|nullgetName()
public
getName() : string
Return values
stringisActivated()
public
isActivated() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolsetActivated()
public
setActivated(bool $activated) : $this
Parameters
- $activated : bool
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetName()
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>