CoolCMS API

Advert extends Advert
in package

Admin variant of an advert, hydrated from `api/bazaar/advert`.

Maps the scalar columns of the Shared parent, the inserting user (user via insert_user_id) and the advert parameters. The advert title is the dynamic parameter name, see getName(). Serves as a picker target and for inline moderation in the list.

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_bazaar_adverts'
#[TableAlias]
'advert'

Table of Contents

Properties

$activationKey  : string|null
$approvedAt  : DateTime|null
$asset  : TImage|null
$assetRels  : Collection<int, AdvertAssetRel>
Image attachments of the advert, read-only: used to show the existing ones in the edit form.
$banned  : bool
$categoryRels  : Collection<int, AdvertCategoryRel>
Advert categories (M:N), saved as a real object graph (owned, cascade and orphan removal), like `parameterRels` above. The edit form builds the `AdvertCategoryRel` collection directly ({@see \App\UI\Admin\Bazaar\Presenters\Traits\Forms\AdvertFormTrait::applyCategoryRels()}).
$confirmedAt  : DateTime|null
$deactivated  : bool
$deleted  : bool
$email  : string
$expirationDate  : DateTime|null
$fakeViewsDetail  : int
$fakeViewsList  : int
$fileRels  : Collection<int, AdvertFileRel>
File attachments of the advert, read-only: used to show the existing ones in the edit form.
$followers  : Collection<int, AdvertFollower>
Followers of the advert (inverse side, owned by {@see AdvertFollower::$advert}), read-only through `->include(['followers'])`. Without this redeclaration the Shared parent has only an unmapped property without `#[CollectionOf]`, so the hydrator passes a raw `array` and `setFollowers(Collection)` fails with a TypeError. `#[Transient]` keeps `EntityHydrator` from extracting it on save; otherwise a load with `followers` would send them back in the payload and the Api would hydrate them as new `AdvertFollower` without cascade persist, and flush fails with "A new entity was found through the relationship". Followers change only through their own Api `AdvertFollower`.
$id  : int|null
$insertDatetime  : DateTime
$insertIp  : string|null
$insertLanguageId  : int|null
$insertLocalizationId  : int|null
$insertUserId  : int|null
$manageKeyExpires  : DateTime|null
$manageKeyHash  : string|null
$noticeDeactivation  : bool
$noticeExpiration  : bool
$ownerBanned  : bool
$paid  : bool
$parameterRels  : Collection<int, AdvertParameterRel>
Advert parameters, saved as a real object graph (owned, cascade and orphan removal).
$password  : string
$passwordResetExpires  : DateTime|null
$passwordResetHash  : string|null
$price  : string|null
$ratingThreadId  : int|null
$region  : TRegion|null
$regionId  : int|null
$reported  : bool
$sold  : bool
$topedUntil  : DateTime|null
$user  : TUser|null
$viewsDetail  : int
$viewsList  : int
$parameterEditorKeys  : array<string, true>
$parameterIndex  : array<string, array<int, string|null>>|null
$parameterRenderModes  : array<string, ContentFilterMode}>
$renderBlacklistedWords  : array<string|int, string>
$renderUrlsAllowed  : bool
Render-time URL replacement (`disallowUrl` is `OnRender`) is skipped; set by the presenter for a paid "Show links" tariff.

Methods

__construct()  : mixed
addAssetRel()  : $this
addCategoryRel()  : $this
addFileRel()  : $this
addParameterRel()  : $this
assetRelCollectionInit()  : void
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
categoryRelCollectionInit()  : void
clearParameterRels()  : $this
fileRelCollectionInit()  : void
get()  : mixed
Returns the parameter value by its key.
getActivationKey()  : string|null
getActive()  : bool
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getApprovedAt()  : DateTime|null
getAsset()  : TImage|null
getAssetRels()  : Collection<int, TAssetRel>
getAssets()  : array<int, mixed>
Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).
getBanned()  : bool
getCategories()  : array<int, object>
getCategoryRels()  : Collection<int, TCategoryRel>
getConfirmedAt()  : DateTime|null
getDeactivated()  : bool
getDeleted()  : bool
getEmail()  : string
getExpirationDate()  : DateTime|null
getFakeViewsDetail()  : int
getFakeViewsList()  : int
getFileRels()  : Collection<int, TFileRel>
getFollowers()  : Collection<int, AdvertFollower>
getId()  : int|null
getInsertDatetime()  : DateTime
getInsertIp()  : string|null
getInsertLanguageId()  : int|null
getInsertLocalizationId()  : int|null
getInsertUserId()  : int|null
getMainAsset()  : Asset|null
getManageKeyExpires()  : DateTime|null
getManageKeyHash()  : string|null
getName()  : string
Returns the advert title, the dynamic parameter `name` from `parameterRels`.
getNoticeDeactivation()  : bool
getNoticeExpiration()  : bool
getOwnerBanned()  : bool
Whether the owner's account is banned (read-only, see the property).
getOwnerUserId()  : int|null
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
getPaid()  : bool
getParameterRels()  : Collection<int, TParameterRel>
getPassword()  : string
Password hash (or the random secret of a guest post) the key is bound to; empty = no key can be issued.
getPasswordResetExpires()  : DateTime|null
getPasswordResetHash()  : string|null
getPrice()  : float|null
getRatingThreadId()  : int|null
getRegion()  : TRegion|null
getRegionId()  : int|null
getReported()  : bool
getSold()  : bool
getString()  : string
Returns the parameter value as text (titles, meta, OG) with the content filter, like {@see get()}.
getTopedUntil()  : DateTime|null
getUser()  : TUser|null
getViewsDetail()  : int
getViewsList()  : int
isActive()  : bool
isApproved()  : bool
isBanned()  : bool
isConfirmed()  : bool
isDeactivated()  : bool
isDeleted()  : bool
isInPaidCategory()  : bool
Whether the record lies in a paid category (a category without `forFree`); its extension is then a paid renewal (decision 19. 10. 2026). Needs the categories loaded (`categoryRels.category`).
isInRenewalWindow()  : bool
Expired, or expiring within `$days` days: the window in which extending / renewing is offered.
isNoticeDeactivation()  : bool
isNoticeExpiration()  : bool
isPaid()  : bool
isPersisted()  : bool
isReported()  : bool
isSold()  : bool
isToped()  : bool
parameterRelCollectionInit()  : void
removeAssetRel()  : $this
removeCategoryRel()  : $this
removeFileRel()  : $this
removeParameterRel()  : $this
setActivationKey()  : $this
setApprovedAt()  : $this
setAsset()  : $this
setAssetRels()  : $this
IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.
setBanned()  : $this
setCategoryRels()  : $this
setConfirmedAt()  : $this
setDeactivated()  : $this
setDeleted()  : $this
setEmail()  : $this
setExpirationDate()  : $this
setFakeViewsDetail()  : $this
setFakeViewsList()  : $this
setFileRels()  : $this
setFollowers()  : $this
setId()  : $this
setInsertDatetime()  : $this
setInsertIp()  : $this
setInsertLanguageId()  : $this
setInsertLocalizationId()  : $this
setInsertUserId()  : $this
setManageKeyExpires()  : $this
setManageKeyHash()  : $this
setNoticeDeactivation()  : $this
setNoticeExpiration()  : $this
setPaid()  : $this
setParameterRels()  : $this
setPassword()  : $this
setPasswordResetExpires()  : $this
setPasswordResetHash()  : $this
setPrice()  : $this
setRatingThreadId()  : $this
setRegion()  : $this
setRegionId()  : $this
setRenderBlacklistedWords()  : $this
Sets the context for the render-time content filter: the deny-listed words in the target language.
setRenderUrlsAllowed()  : $this
Lets web addresses through the render-time filter (the advert has an active "Show links" tariff, {@see \App\Core\Config\AdvertLinksConfig}). Only the `OnRender` mode is skipped: with `OnSave` the database already holds the placeholder.
setReported()  : $this
setSold()  : $this
setTopedUntil()  : $this
setUser()  : $this
setViewsDetail()  : $this
setViewsList()  : $this
usesEditor()  : bool
Returns whether the parameter value is editor HTML (`useEditor`).
buildParameterIndex()  : array<string, array<int, string|null>>
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$activationKey

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

$approvedAt

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

$asset

protected TImage|null $asset = null
Attributes
#[FieldAccess]
$read: Audience::All
$insert: Audience::Privileged
$update: Audience::Privileged
#[Transient]

$assetRels

Image attachments of the advert, read-only: used to show the existing ones in the edit form.

protected Collection<int, AdvertAssetRel> $assetRels

defaultSkipFields does not guard writes through this collection (the hydrator merges it before skip fields apply, as with $categoryRels). The clone carries it as a reference, the merge branch does not match, and flush risks orphan removal and EntityMissingAssignedId. New images are written by the Api afterSave through meta['assets'].

Attributes
#[CollectionOf]
\App\UI\Admin\Bazaar\Models\Entities\AdvertAssetRel::class
#[OneToMany]
$targetEntity: \App\UI\Admin\Bazaar\Models\Entities\AdvertAssetRel::class
$mappedBy: 'advert'
$fetch: "LAZY"

$banned

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

$categoryRels

Advert categories (M:N), saved as a real object graph (owned, cascade and orphan removal), like `parameterRels` above. The edit form builds the `AdvertCategoryRel` collection directly ({@see \App\UI\Admin\Bazaar\Presenters\Traits\Forms\AdvertFormTrait::applyCategoryRels()}).

protected Collection<int, AdvertCategoryRel> $categoryRels

EntityHydrator::extract serializes it in full (owned: true) and the Api merges it through Doctrine cascade and orphan removal. The categories also decide which dynamic parameters the edit form shows.

IMPORTANT: an empty collection means something different than in parameterRels. The admin producer always calls setCategoryRels(), so an empty array means all categories were removed and orphan removal deletes them. For parameterRels an empty array is not sent and the clone stays untouched.

Attributes
#[CollectionOf]
\App\UI\Admin\Bazaar\Models\Entities\AdvertCategoryRel::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Bazaar\Models\Entities\AdvertCategoryRel::class
$mappedBy: 'advert'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"

$confirmedAt

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

$deactivated

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

$deleted

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

$email

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

$expirationDate

protected DateTime|null $expirationDate = null
Attributes
#[Column]
$name: 'expiration_date'
$type: 'date'
#[ExternalReadonly]

$fakeViewsDetail

protected int $fakeViewsDetail = 0
Attributes
#[Column]
$name: 'fake_views_detail'
$type: 'bigint'
$options: ['unsigned' => true]
#[ExternalReadonly]

$fakeViewsList

protected int $fakeViewsList = 0
Attributes
#[Column]
$name: 'fake_views_list'
$type: 'bigint'
$options: ['unsigned' => true]
#[ExternalReadonly]

$fileRels

File attachments of the advert, read-only: used to show the existing ones in the edit form.

protected Collection<int, AdvertFileRel> $fileRels

defaultSkipFields does not guard writes through this collection (the hydrator merges it before skip fields apply, as with $categoryRels). The clone carries it as a reference, the merge branch does not match, and flush risks orphan removal and EntityMissingAssignedId. New files are written by the Api afterSave through meta['files'].

Attributes
#[CollectionOf]
\App\UI\Admin\Bazaar\Models\Entities\AdvertFileRel::class
#[OneToMany]
$targetEntity: \App\UI\Admin\Bazaar\Models\Entities\AdvertFileRel::class
$mappedBy: 'advert'
$fetch: "LAZY"

$followers

Followers of the advert (inverse side, owned by {@see AdvertFollower::$advert}), read-only through `->include(['followers'])`. Without this redeclaration the Shared parent has only an unmapped property without `#[CollectionOf]`, so the hydrator passes a raw `array` and `setFollowers(Collection)` fails with a TypeError. `#[Transient]` keeps `EntityHydrator` from extracting it on save; otherwise a load with `followers` would send them back in the payload and the Api would hydrate them as new `AdvertFollower` without cascade persist, and flush fails with "A new entity was found through the relationship". Followers change only through their own Api `AdvertFollower`.

protected Collection<int, AdvertFollower> $followers
Attributes
#[CollectionOf]
\App\UI\Admin\Bazaar\Models\Entities\AdvertFollower::class
#[OneToMany]
$targetEntity: \App\UI\Admin\Bazaar\Models\Entities\AdvertFollower::class
$mappedBy: 'advert'
$fetch: "LAZY"
#[Transient]

$id

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

$insertLanguageId

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

$insertLocalizationId

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

$insertUserId

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

$manageKeyExpires

protected DateTime|null $manageKeyExpires = null
Attributes
#[Column]
$name: 'manage_key_expires'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::None
$insert: Audience::None
$update: Audience::None

$manageKeyHash

protected string|null $manageKeyHash = null
Attributes
#[Column]
$name: 'manage_key_hash'
$type: 'string'
$length: 64
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::None
$insert: Audience::None
$update: Audience::None

$noticeDeactivation

protected bool $noticeDeactivation = false
Attributes
#[Column]
$name: 'notice_deactivation'
$type: 'boolean'
#[ExternalReadonly]

$noticeExpiration

protected bool $noticeExpiration = false
Attributes
#[Column]
$name: 'notice_expiration'
$type: 'boolean'
#[ExternalReadonly]

$ownerBanned

protected bool $ownerBanned = false
Attributes
#[Column]
$name: 'owner_banned'
$type: 'boolean'
$insertable: false
$updatable: false
$options: ['default' => false]
#[ExternalReadonly]

$parameterRels

Advert parameters, saved as a real object graph (owned, cascade and orphan removal).

protected Collection<int, AdvertParameterRel> $parameterRels

AdvertFormTrait writes them as a collection of AdvertParameterRel directly (not through meta['parameters']).

Attributes
#[CollectionOf]
\App\UI\Admin\Bazaar\Models\Entities\AdvertParameterRel::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Bazaar\Models\Entities\AdvertParameterRel::class
$mappedBy: 'advert'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"

$password

protected string $password = ''
Attributes
#[Column]
$name: 'password'
$type: 'string'
$length: 80
#[FieldAccess]
$read: Audience::Internal
$insert: Audience::All
$update: Audience::All

$passwordResetExpires

protected DateTime|null $passwordResetExpires = null
Attributes
#[Column]
$name: 'password_reset_expires'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::None
$insert: Audience::None
$update: Audience::None

$passwordResetHash

protected string|null $passwordResetHash = null
Attributes
#[Column]
$name: 'password_reset_hash'
$type: 'string'
$length: 64
$nullable: true
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::None
$insert: Audience::None
$update: Audience::None

$price

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

$ratingThreadId

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

$region

protected TRegion|null $region = null
Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\Region::class
#[JoinColumn]
$name: 'cms_system_regions_region_id'
$referencedColumnName: 'region_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\System\Models\Entities\Region::class
$fetch: "LAZY"

$regionId

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

$topedUntil

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

$user

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

$viewsDetail

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

$viewsList

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

$parameterEditorKeys

private array<string, true> $parameterEditorKeys = []

Runtime cache: keys of parameters with an editor (useEditor), whose value is HTML

Attributes
#[Transient]

$renderBlacklistedWords

private array<string|int, string> $renderBlacklistedWords = []

Words for render-time replacement (disallowBlacklistedWords is OnRender); set by the presenter before rendering.

Attributes
#[FieldAccess]
$read: \App\Core\Attributes\Hydration\Audience::All
$insert: \App\Core\Attributes\Hydration\Audience::Privileged
$update: \App\Core\Attributes\Hydration\Audience::Privileged
#[Transient]

$renderUrlsAllowed

Render-time URL replacement (`disallowUrl` is `OnRender`) is skipped; set by the presenter for a paid "Show links" tariff.

private bool $renderUrlsAllowed = false
Attributes
#[FieldAccess]
$read: \App\Core\Attributes\Hydration\Audience::All
$insert: \App\Core\Attributes\Hydration\Audience::Privileged
$update: \App\Core\Attributes\Hydration\Audience::Privileged
#[Transient]

Methods

__construct()

public __construct([int|null $id = null ][, string $email = '' ][, int $viewsDetail = 0 ][, int $viewsList = 0 ][, int $fakeViewsDetail = 0 ][, int $fakeViewsList = 0 ][, bool $banned = false ][, bool $deleted = false ][, bool $deactivated = false ][, bool $ownerBanned = false ][, bool $paid = false ][, DateTime|null $expirationDate = null ][, DateTime $insertDatetime = new DateTime() ][, string|null $insertIp = null ][, int|null $insertUserId = null ][, int|null $insertLanguageId = null ][, int|null $regionId = null ][, string $password = '' ][, bool $reported = false ][, bool $sold = false ][, bool $noticeDeactivation = false ][, bool $noticeExpiration = false ][, int|null $insertLocalizationId = null ][, DateTime|null $confirmedAt = null ][, DateTime|null $approvedAt = null ][, string|null $activationKey = null ][, string|null $passwordResetHash = null ][, DateTime|null $passwordResetExpires = null ][, string|null $manageKeyHash = null ][, DateTime|null $manageKeyExpires = null ][, DateTime|null $topedUntil = null ][, string|null $price = null ][, int|null $ratingThreadId = null ][, bool $active = false ][, mixed $user = null ][, mixed $asset = null ][, mixed $region = null ][, Collection $categoryRels = new ArrayCollection() ][, Collection $assetRels = new ArrayCollection() ][, Collection $fileRels = new ArrayCollection() ][, Collection $parameterRels = new ArrayCollection() ][, Collection $followers = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$email : string = ''
$viewsDetail : int = 0
$viewsList : int = 0
$fakeViewsDetail : int = 0
$fakeViewsList : int = 0
$banned : bool = false
$deleted : bool = false
$deactivated : bool = false
$ownerBanned : bool = false
$paid : bool = false
$expirationDate : DateTime|null = null
$insertDatetime : DateTime = new DateTime()
$insertIp : string|null = null
$insertUserId : int|null = null
$insertLanguageId : int|null = null
$regionId : int|null = null
$password : string = ''
$reported : bool = false
$sold : bool = false
$noticeDeactivation : bool = false
$noticeExpiration : bool = false
$insertLocalizationId : int|null = null
$confirmedAt : DateTime|null = null
$approvedAt : DateTime|null = null
$activationKey : string|null = null
$passwordResetHash : string|null = null
$passwordResetExpires : DateTime|null = null
$manageKeyHash : string|null = null
$manageKeyExpires : DateTime|null = null
$topedUntil : DateTime|null = null
$price : string|null = null
$ratingThreadId : int|null = null
$active : bool = false
$user : mixed = null
$asset : mixed = null
$region : mixed = null
$categoryRels : Collection = new ArrayCollection()
$assetRels : Collection = new ArrayCollection()
$fileRels : Collection = new ArrayCollection()
$parameterRels : Collection = new ArrayCollection()
$followers : Collection = new ArrayCollection()

addAssetRel()

public addAssetRel(TAssetRel $assetRel) : $this
Parameters
$assetRel : TAssetRel
Return values
$this

addCategoryRel()

public addCategoryRel(TCategoryRel $categoryRel) : $this
Parameters
$categoryRel : TCategoryRel
Return values
$this

addFileRel()

public addFileRel(TFileRel $fileRel) : $this
Parameters
$fileRel : TFileRel
Return values
$this

addParameterRel()

public addParameterRel(TParameterRel $parameterRel) : $this
Parameters
$parameterRel : TParameterRel
Return values
$this

callInitMethods()

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

public callInitMethods() : void

get()

Returns the parameter value by its key.

public get(string $key[, string $type = 'string' ][, bool $alwaysReturnArray = false ]) : mixed
Parameters
$key : string

Parameter key

$type : string = 'string'

'string' | 'int' | 'float' | 'bool'

$alwaysReturnArray : bool = false

returns an array even for a single value

getActivationKey()

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

getActive()

public getActive() : bool
Return values
bool

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>

getApprovedAt()

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

getAsset()

public getAsset() : TImage|null
Return values
TImage|null

getAssetRels()

public getAssetRels() : Collection<int, TAssetRel>
Return values
Collection<int, TAssetRel>

getAssets()

Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).

public getAssets() : array<int, mixed>
Return values
array<int, mixed>

getBanned()

public getBanned() : bool
Return values
bool

getCategories()

public getCategories() : array<int, object>
Return values
array<int, object> —

categories of the rels (a rel without a loaded category is skipped)

getCategoryRels()

public getCategoryRels() : Collection<int, TCategoryRel>
Return values
Collection<int, TCategoryRel>

getConfirmedAt()

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

getDeactivated()

public getDeactivated() : bool
Return values
bool

getDeleted()

public getDeleted() : bool
Return values
bool

getEmail()

public getEmail() : string
Return values
string

getExpirationDate()

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

getFakeViewsDetail()

public getFakeViewsDetail() : int
Return values
int

getFakeViewsList()

public getFakeViewsList() : int
Return values
int

getFileRels()

public getFileRels() : Collection<int, TFileRel>
Return values
Collection<int, TFileRel>

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getInsertIp()

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

getInsertLanguageId()

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

getInsertLocalizationId()

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

getInsertUserId()

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

getManageKeyExpires()

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

getManageKeyHash()

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

getName()

Returns the advert title, the dynamic parameter `name` from `parameterRels`.

public getName() : string

Requires parameterRels.parameter to be loaded (it carries the parameter key).

Return values
string

getNoticeDeactivation()

public getNoticeDeactivation() : bool
Return values
bool

getNoticeExpiration()

public getNoticeExpiration() : bool
Return values
bool

getOwnerBanned()

Whether the owner's account is banned (read-only, see the property).

public getOwnerBanned() : bool
Return values
bool

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

getPaid()

public getPaid() : bool
Return values
bool

getParameterRels()

public getParameterRels() : Collection<int, TParameterRel>
Return values
Collection<int, TParameterRel>

getPassword()

Password hash (or the random secret of a guest post) the key is bound to; empty = no key can be issued.

public getPassword() : string
Return values
string

getPasswordResetExpires()

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

getPasswordResetHash()

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

getPrice()

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

getRatingThreadId()

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

getRegion()

public getRegion() : TRegion|null
Return values
TRegion|null

getRegionId()

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

getReported()

public getReported() : bool
Return values
bool

getSold()

public getSold() : bool
Return values
bool

getString()

Returns the parameter value as text (titles, meta, OG) with the content filter, like {@see get()}.

public getString(string $key) : string

Multiple values are joined by a comma; get() would return an array for them and the string would read "Array".

Parameters
$key : string
Return values
string

getTopedUntil()

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

getUser()

public getUser() : TUser|null
Return values
TUser|null

getViewsDetail()

public getViewsDetail() : int
Return values
int

getViewsList()

public getViewsList() : int
Return values
int

isActive()

public isActive() : bool
Return values
bool

isApproved()

public isApproved() : bool
Return values
bool

isBanned()

public isBanned() : bool
Return values
bool

isConfirmed()

public isConfirmed() : bool
Return values
bool

isDeactivated()

public isDeactivated() : bool
Return values
bool

isDeleted()

public isDeleted() : bool
Return values
bool

isInPaidCategory()

Whether the record lies in a paid category (a category without `forFree`); its extension is then a paid renewal (decision 19. 10. 2026). Needs the categories loaded (`categoryRels.category`).

public isInPaidCategory() : bool
Return values
bool

isInRenewalWindow()

Expired, or expiring within `$days` days: the window in which extending / renewing is offered.

public isInRenewalWindow([int $days = 2 ]) : bool
Parameters
$days : int = 2
Return values
bool

isNoticeDeactivation()

public isNoticeDeactivation() : bool
Return values
bool

isNoticeExpiration()

public isNoticeExpiration() : bool
Return values
bool

isPaid()

public isPaid() : bool
Return values
bool

isReported()

public isReported() : bool
Return values
bool

isSold()

public isSold() : bool
Return values
bool

isToped()

public isToped() : bool
Return values
bool

removeAssetRel()

public removeAssetRel(TAssetRel $assetRel) : $this
Parameters
$assetRel : TAssetRel
Return values
$this

removeCategoryRel()

public removeCategoryRel(TCategoryRel $categoryRel) : $this
Parameters
$categoryRel : TCategoryRel
Return values
$this

removeFileRel()

public removeFileRel(TFileRel $fileRel) : $this
Parameters
$fileRel : TFileRel
Return values
$this

removeParameterRel()

public removeParameterRel(TParameterRel $parameterRel) : $this
Parameters
$parameterRel : TParameterRel
Return values
$this

setActivationKey()

public setActivationKey(string|null $activationKey) : $this
Parameters
$activationKey : string|null
Return values
$this

setApprovedAt()

public setApprovedAt(DateTime|null $approvedAt) : $this
Parameters
$approvedAt : DateTime|null
Return values
$this

setAsset()

public setAsset(TImage|null $asset) : $this
Parameters
$asset : TImage|null
Return values
$this

setAssetRels()

IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.

public setAssetRels(Collection<int, TAssetRel> $assetRels) : $this
Parameters
$assetRels : Collection<int, TAssetRel>
Return values
$this

setBanned()

public setBanned(bool $banned) : $this
Parameters
$banned : bool
Return values
$this

setCategoryRels()

public setCategoryRels(Collection<int, TCategoryRel>|array<int, TCategoryRel> $categoryRels) : $this
Parameters
$categoryRels : Collection<int, TCategoryRel>|array<int, TCategoryRel>
Return values
$this

setConfirmedAt()

public setConfirmedAt(DateTime|null $confirmedAt) : $this
Parameters
$confirmedAt : DateTime|null
Return values
$this

setDeactivated()

public setDeactivated(bool $deactivated) : $this
Parameters
$deactivated : bool
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

setExpirationDate()

public setExpirationDate(DateTime|null $expirationDate) : $this
Parameters
$expirationDate : DateTime|null
Return values
$this

setFakeViewsDetail()

public setFakeViewsDetail(int $fakeViewsDetail) : $this
Parameters
$fakeViewsDetail : int
Return values
$this

setFakeViewsList()

public setFakeViewsList(int $fakeViewsList) : $this
Parameters
$fakeViewsList : int
Return values
$this

setFileRels()

public setFileRels(Collection<int, TFileRel>|array<int, TFileRel> $fileRels) : $this
Parameters
$fileRels : Collection<int, TFileRel>|array<int, TFileRel>
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

setInsertLanguageId()

public setInsertLanguageId(int|null $insertLanguageId) : $this
Parameters
$insertLanguageId : int|null
Return values
$this

setInsertLocalizationId()

public setInsertLocalizationId(int|null $insertLocalizationId) : $this
Parameters
$insertLocalizationId : int|null
Return values
$this

setInsertUserId()

public setInsertUserId(int|null $insertUserId) : $this
Parameters
$insertUserId : int|null
Return values
$this

setManageKeyExpires()

public setManageKeyExpires(DateTime|null $manageKeyExpires) : $this
Parameters
$manageKeyExpires : DateTime|null
Return values
$this

setManageKeyHash()

public setManageKeyHash(string|null $manageKeyHash) : $this
Parameters
$manageKeyHash : string|null
Return values
$this

setNoticeDeactivation()

public setNoticeDeactivation(bool $noticeDeactivation) : $this
Parameters
$noticeDeactivation : bool
Return values
$this

setNoticeExpiration()

public setNoticeExpiration(bool $noticeExpiration) : $this
Parameters
$noticeExpiration : bool
Return values
$this

setPaid()

public setPaid(bool $paid) : $this
Parameters
$paid : bool
Return values
$this

setParameterRels()

public setParameterRels(Collection<int, TParameterRel>|array<int, TParameterRel> $parameterRels) : $this
Parameters
$parameterRels : Collection<int, TParameterRel>|array<int, TParameterRel>
Return values
$this

setPassword()

public setPassword(string $password) : $this
Parameters
$password : string
Return values
$this

setPasswordResetExpires()

public setPasswordResetExpires(DateTime|null $passwordResetExpires) : $this
Parameters
$passwordResetExpires : DateTime|null
Return values
$this

setPasswordResetHash()

public setPasswordResetHash(string|null $passwordResetHash) : $this
Parameters
$passwordResetHash : string|null
Return values
$this

setPrice()

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

setRatingThreadId()

public setRatingThreadId(int|null $ratingThreadId) : $this
Parameters
$ratingThreadId : int|null
Return values
$this

setRegion()

public setRegion(TRegion|null $region) : $this
Parameters
$region : TRegion|null
Return values
$this

setRegionId()

public setRegionId(int|null $regionId) : $this
Parameters
$regionId : int|null
Return values
$this

setRenderBlacklistedWords()

Sets the context for the render-time content filter: the deny-listed words in the target language.

public setRenderBlacklistedWords(array<string|int, string> $words) : $this

Without it the word replacement (OnRender) is skipped; URL replacement does not depend on it.

Parameters
$words : array<string|int, string>
Return values
$this

setRenderUrlsAllowed()

Lets web addresses through the render-time filter (the advert has an active "Show links" tariff, {@see \App\Core\Config\AdvertLinksConfig}). Only the `OnRender` mode is skipped: with `OnSave` the database already holds the placeholder.

public setRenderUrlsAllowed(bool $allowed) : $this
Parameters
$allowed : bool
Return values
$this

setReported()

public setReported(bool $reported) : $this
Parameters
$reported : bool
Return values
$this

setSold()

public setSold(bool $sold) : $this
Parameters
$sold : bool
Return values
$this

setTopedUntil()

public setTopedUntil(DateTime|null $topedUntil) : $this
Parameters
$topedUntil : DateTime|null
Return values
$this

setUser()

public setUser(TUser|null $user) : $this
Parameters
$user : TUser|null
Return values
$this

setViewsDetail()

public setViewsDetail(int $viewsDetail) : $this
Parameters
$viewsDetail : int
Return values
$this

setViewsList()

public setViewsList(int $viewsList) : $this
Parameters
$viewsList : int
Return values
$this

usesEditor()

Returns whether the parameter value is editor HTML (`useEditor`).

public usesEditor(string $key) : bool

Templates choose between |noescape (the HTML is sanitized in the Api on write) and escaped output by it. The parameter setting decides, not the presence of tags in the text.

Parameters
$key : string
Return values
bool

buildParameterIndex()

private buildParameterIndex() : array<string, array<int, string|null>>
Return values
array<string, array<int, string|null>>

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