CoolCMS API

MessageVote extends BaseEntity
in package
implements OwnerAwareInterface, IdentifiableInterface uses IdentifiableTrait

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

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

$id  : int|null
$insertDatetime  : DateTime
$insertIp  : string|null
$messageId  : int|null
$userId  : int|null
$vote  : int

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.
getId()  : int|null
getInsertDatetime()  : DateTime
getInsertIp()  : string|null
getMessageId()  : int|null
getOwnerUserId()  : int|null
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
getUserId()  : int|null
getVote()  : int
isPersisted()  : bool
setId()  : $this
setInsertDatetime()  : $this
setInsertIp()  : $this
setMessageId()  : $this
setUserId()  : $this
setVote()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$id

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

$insertDatetime

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

$insertIp

protected string|null $insertIp = null
Attributes
#[Column]
$name: 'insert_ip'
$type: 'string'
$length: 45
$nullable: true
#[ExternalReadonly]
#[PersonalData]
PersonalDataKind::Hidden

$messageId

protected int|null $messageId = null
Attributes
#[Column]
$name: 'cms_mod_discussion_messages_message_id'
$type: 'integer'
$options: ['unsigned' => true]

$userId

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

$vote

protected int $vote = 0
Attributes
#[Column]
$name: 'vote'
$type: 'integer'
$options: ['unsigned' => true]

Methods

__construct()

public __construct([int|null $id = null ][, int|null $messageId = null ][, int|null $userId = null ][, string|null $insertIp = null ][, int $vote = 0 ][, DateTime $insertDatetime = new DateTime() ]) : mixed
Parameters
$id : int|null = null
$messageId : int|null = null
$userId : int|null = null
$insertIp : string|null = null
$vote : int = 0
$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>

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getInsertIp()

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

getMessageId()

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

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

getUserId()

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

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

setInsertIp()

public setInsertIp(string|null $ip) : $this
Parameters
$ip : string|null
Return values
$this

setMessageId()

public setMessageId(int|null $messageId) : $this
Parameters
$messageId : int|null
Return values
$this

setUserId()

public setUserId(int|null $userId) : $this
Parameters
$userId : int|null
Return values
$this

setVote()

public setVote(int $vote) : $this
Parameters
$vote : int
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