CoolCMS API

Email extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait, TranslationCollectionTrait

AbstractYes
Tags
template
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'email'

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

$active  : bool
$files  : string|null
$id  : int|null
$insertDate  : DateTime
$key  : string
$preferred  : bool
$sendImmediately  : bool
$translations  : Collection<int, TTranslation>

Methods

__construct()  : mixed
addTranslation()  : $this
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getFiles()  : string|null
getFilesUnserialized()  : array<int, File>
getId()  : int|null
getInsertDate()  : DateTime
getKey()  : string
getPreferred()  : bool
getSendImmediately()  : bool
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
isActive()  : bool
isPersisted()  : bool
isPreferred()  : bool
isSendImmediately()  : bool
removeTranslation()  : $this
setActive()  : $this
setFiles()  : $this
setId()  : $this
setInsertDate()  : $this
setKey()  : $this
setPreferred()  : $this
setSendImmediately()  : $this
setTranslations()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$active

protected bool $active = true
Attributes
#[Column]
$name: 'active'
$type: 'boolean'

$files

protected string|null $files = null
Attributes
#[Column]
$name: 'files'
$type: 'text'
$nullable: true

$id

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

$insertDate

protected DateTime $insertDate = new DateTime()
Attributes
#[Column]
$name: 'insert_date'
$type: 'date'
#[ExternalReadonly]

$key

protected string $key = ''
Attributes
#[Column]
$name: 'email_key'
$type: 'string'
$length: 40
$unique: true

$preferred

protected bool $preferred = false
Attributes
#[Column]
$name: 'preferred'
$type: 'boolean'

$sendImmediately

protected bool $sendImmediately = false
Attributes
#[Column]
$name: 'send_immediately'
$type: 'boolean'

$translations

protected Collection<int, TTranslation> $translations = new ArrayCollection()

Methods

__construct()

public __construct([int|null $id = null ][, string $key = '' ][, bool $preferred = false ][, bool $sendImmediately = false ][, DateTime $insertDate = new DateTime() ][, string|null $files = null ][, bool $active = true ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$key : string = ''
$preferred : bool = false
$sendImmediately : bool = false
$insertDate : DateTime = new DateTime()
$files : string|null = null
$active : bool = true
$translations : Collection = new ArrayCollection()

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getAllTraits()

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>

getFiles()

public getFiles() : string|null
Return values
string|null

getFilesUnserialized()

public getFilesUnserialized() : array<int, File>
Return values
array<int, File>

getInsertDate()

public getInsertDate() : DateTime
Return values
DateTime

getKey()

public getKey() : string
Return values
string

getPreferred()

public getPreferred() : bool
Return values
bool

getSendImmediately()

public getSendImmediately() : bool
Return values
bool

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

isActive()

public isActive() : bool
Return values
bool

isPreferred()

public isPreferred() : bool
Return values
bool

isSendImmediately()

public isSendImmediately() : bool
Return values
bool

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

setActive()

public setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

setFiles()

public setFiles(string|null $files) : $this
Parameters
$files : string|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertDate()

public setInsertDate(DateTime $insertDate) : $this
Parameters
$insertDate : DateTime
Return values
$this

setKey()

public setKey(string $key) : $this
Parameters
$key : string
Return values
$this

setPreferred()

public setPreferred(bool $preferred) : $this
Parameters
$preferred : bool
Return values
$this

setSendImmediately()

public setSendImmediately(bool $sendImmediately) : $this
Parameters
$sendImmediately : bool
Return values
$this

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$this

getTraitsRecursive()

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>
Return values
array<string, string>
On this page

Search results