CoolCMS API

Response extends Response
in package

Admin variant of a response to a company profile, hydrated from `api/comcat/response`.

The profile and the sender are object associations (the list shows the profile title and the user name with links). The scalar userId is read-only: the FK is written through the $user association (object graph), while getUserId() still reads it.

Tags
extends
Attributes
#[AttributeOverrides]
[new \Doctrine\ORM\Mapping\AttributeOverride('userId', new \Doctrine\ORM\Mapping\Column(name: 'cms_system_users_user_id', type: 'integer', nullable: true, insertable: false, updatable: false, options: ['unsigned' => true]))]
#[Entity]
#[Table]
$name: 'cms_mod_comcat_advert_responses'
#[TableAlias]
'response'

Table of Contents

Properties

$advert  : TAdvert|null
$advertId  : int
$currencyId  : int|null
$deleted  : bool
$email  : string
$id  : int|null
$insertDatetime  : DateTime
$insertIp  : string|null
$messageThreadId  : int|null
$phone  : string|null
$price  : string|null
$read  : bool
$readKey  : string|null
$subject  : string|null
$text  : string
$user  : User|null
Sender of the response, the owner of the column `cms_system_users_user_id` (`userId` is read-only).
$userId  : int|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAdvert()  : TAdvert|null
getAdvertId()  : int
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getCurrencyId()  : int|null
getDeleted()  : bool
getEmail()  : string
getId()  : int|null
getInsertDatetime()  : DateTime
getInsertIp()  : string|null
getMessageThreadId()  : int|null
getOwnerUserId()  : int|null
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
getPhone()  : string|null
getPrice()  : string|null
getPriceAsFloat()  : float|null
getRead()  : bool
getReadKey()  : string|null
getSubject()  : string|null
getText()  : string
getUser()  : User|null
getUserId()  : int|null
isDeleted()  : bool
isPersisted()  : bool
isRead()  : bool
setAdvert()  : $this
setAdvertId()  : $this
setCurrencyId()  : $this
setDeleted()  : $this
setEmail()  : $this
setId()  : $this
setInsertDatetime()  : $this
setInsertIp()  : $this
setMessageThreadId()  : $this
setPhone()  : $this
setPrice()  : $this
setPriceFromFloat()  : $this
setRead()  : $this
setReadKey()  : static
setSubject()  : $this
setText()  : $this
setUser()  : self
setUserId()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$advert

protected TAdvert|null $advert = null
Attributes
#[EntityOf]
\App\UI\Admin\Comcat\Models\Entities\Advert::class
#[JoinColumn]
$name: 'cms_mod_comcat_adverts_advert_id'
$referencedColumnName: 'advert_id'
$nullable: true
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Comcat\Models\Entities\Advert::class
$fetch: 'LAZY'

$advertId

protected int $advertId = 0
Attributes
#[Column]
$name: 'cms_mod_comcat_adverts_advert_id'
$type: 'integer'
$options: ['unsigned' => true]
#[FieldAccess]
$read: Audience::All
$insert: Audience::All
$update: Audience::Privileged

$currencyId

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

$email

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

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'advert_response_id'
$type: 'integer'
$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

$messageThreadId

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

$phone

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

$price

protected string|null $price = null
Attributes
#[Column]
$name: 'price'
$type: 'decimal'
$precision: 10
$scale: 3
$nullable: true

$read

protected bool $read = false
Attributes
#[Column]
$name: '`read`'
$type: 'boolean'
#[ConditionallyUpdatable]
$check: 'checkPermissionForRead'
#[FieldAccess]
$read: Audience::All
$insert: Audience::Privileged
$update: Audience::Privileged

$readKey

protected string|null $readKey = null
Attributes
#[Column]
$name: 'read_key'
$type: 'string'
$length: 64
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::Internal
$insert: Audience::All
$update: Audience::All

$subject

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

$text

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

$user

Sender of the response, the owner of the column `cms_system_users_user_id` (`userId` is read-only).

protected User|null $user = null
Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\User::class
#[JoinColumn]
$name: 'cms_system_users_user_id'
$referencedColumnName: 'user_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\System\Models\Entities\User::class
$fetch: 'LAZY'

$userId

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

Methods

__construct()

public __construct([int|null $id = null ][, int $advertId = 0 ][, string $email = '' ][, string|null $phone = null ][, string|null $subject = null ][, string $text = '' ][, int|null $userId = null ][, DateTime $insertDatetime = new DateTime() ][, string|null $insertIp = null ][, bool $read = false ][, bool $deleted = false ][, string|null $price = null ][, int|null $currencyId = null ][, int|null $messageThreadId = null ][, string|null $readKey = null ]) : mixed
Parameters
$id : int|null = null
$advertId : int = 0
$email : string = ''
$phone : string|null = null
$subject : string|null = null
$text : string = ''
$userId : int|null = null
$insertDatetime : DateTime = new DateTime()
$insertIp : string|null = null
$read : bool = false
$deleted : bool = false
$price : string|null = null
$currencyId : int|null = null
$messageThreadId : int|null = null
$readKey : string|null = null

callInitMethods()

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

public callInitMethods() : void

getAdvert()

public getAdvert() : TAdvert|null
Return values
TAdvert|null

getAdvertId()

public getAdvertId() : int
Return values
int

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>

getCurrencyId()

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

getDeleted()

public getDeleted() : bool
Return values
bool

getEmail()

public getEmail() : string
Return values
string

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getInsertIp()

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

getMessageThreadId()

public getMessageThreadId() : 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

getPhone()

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

getPrice()

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

getPriceAsFloat()

public getPriceAsFloat() : float|null
Return values
float|null

getRead()

public getRead() : bool
Return values
bool

getReadKey()

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

getSubject()

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

getText()

public getText() : string
Return values
string

getUserId()

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

isDeleted()

public isDeleted() : bool
Return values
bool

isRead()

public isRead() : bool
Return values
bool

setAdvert()

public setAdvert(TAdvert|null $advert) : $this
Parameters
$advert : TAdvert|null
Return values
$this

setAdvertId()

public setAdvertId(int $advertId) : $this
Parameters
$advertId : int
Return values
$this

setCurrencyId()

public setCurrencyId(int|null $currencyId) : $this
Parameters
$currencyId : int|null
Return values
$this

setDeleted()

public setDeleted(bool $deleted) : $this
Parameters
$deleted : bool
Return values
$this

setEmail()

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

setId()

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

setInsertDatetime()

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

setInsertIp()

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

setMessageThreadId()

public setMessageThreadId(int|null $messageThreadId) : $this
Parameters
$messageThreadId : int|null
Return values
$this

setPhone()

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

setPrice()

public setPrice(string|null $price) : $this
Parameters
$price : string|null
Return values
$this

setPriceFromFloat()

public setPriceFromFloat(float|null $price) : $this
Parameters
$price : float|null
Return values
$this

setRead()

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

setReadKey()

public setReadKey(string|null $readKey) : static
Parameters
$readKey : string|null
Return values
static

setSubject()

public setSubject(string|null $subject) : $this
Parameters
$subject : string|null
Return values
$this

setText()

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

setUser()

public setUser(User|null $user) : self
Parameters
$user : User|null
Return values
self

setUserId()

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