CoolCMS API

ContactMessage extends BaseEntity
in package
implements OwnerAwareInterface, IdentifiableInterface uses IdentifiableTrait

AbstractYes
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'contactMessage'

Table of Contents

Interfaces

OwnerAwareInterface
Entity that knows who created it (the owner is the author or sender of the record); the named entry point to the generic base of the conditional RBAC role `owner`.
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

$answerDatetime  : DateTime|null
$answered  : bool
$email  : string
$id  : int|null
$insertDatetime  : DateTime
$phone  : string|null
$read  : bool
$readDatetime  : DateTime|null
$subject  : string
$text  : string
$userId  : int|null

Methods

__construct()  : mixed
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.
getAnswerDatetime()  : DateTime|null
getAnswered()  : bool
getEmail()  : string
getId()  : int|null
getInsertDatetime()  : DateTime
getOwnerUserId()  : int|null
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
getPhone()  : string|null
getRead()  : bool
getReadDatetime()  : DateTime|null
getSubject()  : string
getText()  : string
getUserId()  : int|null
isAnswered()  : bool
isPersisted()  : bool
isRead()  : bool
setAnswerDatetime()  : $this
setAnswered()  : $this
setEmail()  : $this
setId()  : $this
setInsertDatetime()  : $this
setPhone()  : $this
setRead()  : $this
setReadDatetime()  : $this
setSubject()  : $this
setText()  : $this
setUserId()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$answerDatetime

protected DateTime|null $answerDatetime = null
Attributes
#[Column]
$type: 'datetime'
$name: 'answer_datetime'
$nullable: true
#[ExternalReadonly]

$answered

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

$email

protected string $email = ''
Attributes
#[Column]
$type: 'string'
$name: 'email'
$length: 255

$id

protected int|null $id = null
Attributes
#[Column]
$type: 'integer'
$name: 'contact_message_id'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$insertDatetime

protected DateTime $insertDatetime = new DateTime()
Attributes
#[Column]
$type: 'datetime'
$name: 'insert_datetime'
#[ExternalReadonly]

$phone

protected string|null $phone = null
Attributes
#[Column]
$type: 'string'
$name: 'phone'
$length: 255
$nullable: true

$read

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

$readDatetime

protected DateTime|null $readDatetime = null
Attributes
#[Column]
$type: 'datetime'
$name: 'read_datetime'
$nullable: true
#[ExternalReadonly]

$subject

protected string $subject = ''
Attributes
#[Column]
$type: 'string'
$name: 'subject'
$length: 255

$text

protected string $text = ''
Attributes
#[Column]
$type: 'text'
$name: 'text'

$userId

protected int|null $userId = null
Attributes
#[Column]
$type: 'integer'
$name: 'cms_system_users_user_id'
$nullable: true
$options: ['unsigned' => true]
#[ExternalReadonly]

Methods

__construct()

public __construct([int|null $id = null ][, int|null $userId = null ][, string $subject = '' ][, string $text = '' ][, string $email = '' ][, string|null $phone = null ][, bool $read = false ][, DateTime|null $readDatetime = null ][, bool $answered = false ][, DateTime|null $answerDatetime = null ][, DateTime $insertDatetime = new DateTime() ]) : mixed
Parameters
$id : int|null = null
$userId : int|null = null
$subject : string = ''
$text : string = ''
$email : string = ''
$phone : string|null = null
$read : bool = false
$readDatetime : DateTime|null = null
$answered : bool = false
$answerDatetime : DateTime|null = null
$insertDatetime : DateTime = new DateTime()

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>

getAnswerDatetime()

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

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getOwnerUserId()

Returns the id of the user who created the record; `null` for an unknown or anonymous owner.

public getOwnerUserId() : int|null
Return values
int|null

getPhone()

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

getReadDatetime()

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

getUserId()

public getUserId() : int|null
Return values
int|null

setAnswerDatetime()

public setAnswerDatetime(DateTime|null $dt) : $this
Parameters
$dt : DateTime|null
Return values
$this

setAnswered()

public setAnswered(bool $a) : $this
Parameters
$a : bool
Return values
$this

setEmail()

public setEmail(string $e) : $this
Parameters
$e : string
Return values
$this

setId()

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

setInsertDatetime()

public setInsertDatetime(DateTime $dt) : $this
Parameters
$dt : DateTime
Return values
$this

setPhone()

public setPhone(string|null $p) : $this
Parameters
$p : string|null
Return values
$this

setRead()

public setRead(bool $r) : $this
Parameters
$r : bool
Return values
$this

setReadDatetime()

public setReadDatetime(DateTime|null $dt) : $this
Parameters
$dt : DateTime|null
Return values
$this

setSubject()

public setSubject(string $s) : $this
Parameters
$s : string
Return values
$this

setText()

public setText(string $t) : $this
Parameters
$t : string
Return values
$this

setUserId()

public setUserId(int|null $id) : $this
Parameters
$id : int|null
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