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
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
- #[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
$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'
$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
$deactivated
protected
bool
$deactivated
= false
Attributes
- #[Column]
- $name: 'deactivated'
- $type: 'boolean'
$deleted
protected
bool
$deleted
= false
Attributes
- #[Column]
- $name: 'deleted'
- $type: 'boolean'
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'
$fakeViewsDetail
protected
int
$fakeViewsDetail
= 0
Attributes
- #[Column]
- $name: 'fake_views_detail'
- $type: 'bigint'
- $options: ['unsigned' => true]
$fakeViewsList
protected
int
$fakeViewsList
= 0
Attributes
- #[Column]
- $name: 'fake_views_list'
- $type: 'bigint'
- $options: ['unsigned' => true]
$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'
$insertIp
protected
string|null
$insertIp
= null
Attributes
- #[Column]
- $name: 'insert_ip'
- $type: 'string'
- $length: 45
- $nullable: true
- #[PersonalData]
- PersonalDataKind::Hidden
$insertLanguageId
protected
int|null
$insertLanguageId
= null
Attributes
- #[Column]
- $name: 'insert_language_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$insertLocalizationId
protected
int|null
$insertLocalizationId
= null
Attributes
- #[Column]
- $name: 'insert_localization_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$insertUserId
protected
int|null
$insertUserId
= null
Attributes
- #[Column]
- $name: 'insert_user_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$manageKeyExpires
protected
DateTime|null
$manageKeyExpires
= null
Attributes
- #[Column]
- $name: 'manage_key_expires'
- $type: 'datetime'
- $nullable: true
- #[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
- #[FieldAccess]
- $read: Audience::None
- $insert: Audience::None
- $update: Audience::None
$noticeDeactivation
protected
bool
$noticeDeactivation
= false
Attributes
- #[Column]
- $name: 'notice_deactivation'
- $type: 'boolean'
$noticeExpiration
protected
bool
$noticeExpiration
= false
Attributes
- #[Column]
- $name: 'notice_expiration'
- $type: 'boolean'
$ownerBanned
protected
bool
$ownerBanned
= false
Attributes
- #[Column]
- $name: 'owner_banned'
- $type: 'boolean'
- $insertable: false
- $updatable: false
- $options: ['default' => false]
$paid
protected
bool
$paid
= false
Attributes
- #[Column]
- $name: 'paid'
- $type: 'boolean'
$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
- #[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
- #[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
$ratingThreadId
protected
int|null
$ratingThreadId
= null
Attributes
- #[Column]
- $name: 'cms_mod_base_rating_threads_rating_thread_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$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]
$reported
protected
bool
$reported
= false
Attributes
- #[Column]
- $name: 'reported'
- $type: 'boolean'
$sold
protected
bool
$sold
= false
Attributes
- #[Column]
- $name: 'sold'
- $type: 'boolean'
$topedUntil
protected
DateTime|null
$topedUntil
= null
Attributes
- #[Column]
- $name: 'toped_until'
- $type: 'datetime'
- $nullable: true
$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]
$viewsList
protected
int
$viewsList
= 0
Attributes
- #[Column]
- $name: 'views_list'
- $type: 'integer'
- $options: ['unsigned' => true]
$parameterEditorKeys
private
array<string, true>
$parameterEditorKeys
= []
Runtime cache: keys of parameters with an editor (useEditor), whose value is HTML
Attributes
- #[Transient]
$parameterIndex
private
array<string, array<int, string|null>>|null
$parameterIndex
= null
Runtime cache: key => [values]
Attributes
- #[Transient]
$parameterRenderModes
private
array<string, ContentFilterMode}>
$parameterRenderModes
= []
Runtime cache: key => [urlMode, wordMode]
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
$thisaddCategoryRel()
public
addCategoryRel(TCategoryRel $categoryRel) : $this
Parameters
- $categoryRel : TCategoryRel
Return values
$thisaddFileRel()
public
addFileRel(TFileRel $fileRel) : $this
Parameters
- $fileRel : TFileRel
Return values
$thisaddParameterRel()
public
addParameterRel(TParameterRel $parameterRel) : $this
Parameters
- $parameterRel : TParameterRel
Return values
$thisassetRelCollectionInit()
public
assetRelCollectionInit() : void
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
categoryRelCollectionInit()
public
categoryRelCollectionInit() : void
clearParameterRels()
public
clearParameterRels() : $this
Return values
$thisfileRelCollectionInit()
public
fileRelCollectionInit() : 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|nullgetActive()
public
getActive() : bool
Return values
boolgetAllTraits()
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|nullgetAsset()
public
getAsset() : TImage|null
Return values
TImage|nullgetAssetRels()
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
boolgetCategories()
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|nullgetDeactivated()
public
getDeactivated() : bool
Return values
boolgetDeleted()
public
getDeleted() : bool
Return values
boolgetEmail()
public
getEmail() : string
Return values
stringgetExpirationDate()
public
getExpirationDate() : DateTime|null
Return values
DateTime|nullgetFakeViewsDetail()
public
getFakeViewsDetail() : int
Return values
intgetFakeViewsList()
public
getFakeViewsList() : int
Return values
intgetFileRels()
public
getFileRels() : Collection<int, TFileRel>
Return values
Collection<int, TFileRel>getFollowers()
public
getFollowers() : Collection<int, AdvertFollower>
Return values
Collection<int, AdvertFollower>getId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetInsertIp()
public
getInsertIp() : string|null
Return values
string|nullgetInsertLanguageId()
public
getInsertLanguageId() : int|null
Return values
int|nullgetInsertLocalizationId()
public
getInsertLocalizationId() : int|null
Return values
int|nullgetInsertUserId()
public
getInsertUserId() : int|null
Return values
int|nullgetMainAsset()
public
getMainAsset() : Asset|null
Return values
Asset|null —main image (else the first non-removed one)
getManageKeyExpires()
public
getManageKeyExpires() : DateTime|null
Return values
DateTime|nullgetManageKeyHash()
public
getManageKeyHash() : string|null
Return values
string|nullgetName()
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
stringgetNoticeDeactivation()
public
getNoticeDeactivation() : bool
Return values
boolgetNoticeExpiration()
public
getNoticeExpiration() : bool
Return values
boolgetOwnerBanned()
Whether the owner's account is banned (read-only, see the property).
public
getOwnerBanned() : bool
Return values
boolgetOwnerUserId()
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
public
getOwnerUserId() : int|null
Return values
int|nullgetPaid()
public
getPaid() : bool
Return values
boolgetParameterRels()
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
stringgetPasswordResetExpires()
public
getPasswordResetExpires() : DateTime|null
Return values
DateTime|nullgetPasswordResetHash()
public
getPasswordResetHash() : string|null
Return values
string|nullgetPrice()
public
getPrice() : float|null
Return values
float|nullgetRatingThreadId()
public
getRatingThreadId() : int|null
Return values
int|nullgetRegion()
public
getRegion() : TRegion|null
Return values
TRegion|nullgetRegionId()
public
getRegionId() : int|null
Return values
int|nullgetReported()
public
getReported() : bool
Return values
boolgetSold()
public
getSold() : bool
Return values
boolgetString()
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
stringgetTopedUntil()
public
getTopedUntil() : DateTime|null
Return values
DateTime|nullgetUser()
public
getUser() : TUser|null
Return values
TUser|nullgetViewsDetail()
public
getViewsDetail() : int
Return values
intgetViewsList()
public
getViewsList() : int
Return values
intisActive()
public
isActive() : bool
Return values
boolisApproved()
public
isApproved() : bool
Return values
boolisBanned()
public
isBanned() : bool
Return values
boolisConfirmed()
public
isConfirmed() : bool
Return values
boolisDeactivated()
public
isDeactivated() : bool
Return values
boolisDeleted()
public
isDeleted() : bool
Return values
boolisInPaidCategory()
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
boolisInRenewalWindow()
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
boolisNoticeDeactivation()
public
isNoticeDeactivation() : bool
Return values
boolisNoticeExpiration()
public
isNoticeExpiration() : bool
Return values
boolisPaid()
public
isPaid() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisReported()
public
isReported() : bool
Return values
boolisSold()
public
isSold() : bool
Return values
boolisToped()
public
isToped() : bool
Return values
boolparameterRelCollectionInit()
public
parameterRelCollectionInit() : void
removeAssetRel()
public
removeAssetRel(TAssetRel $assetRel) : $this
Parameters
- $assetRel : TAssetRel
Return values
$thisremoveCategoryRel()
public
removeCategoryRel(TCategoryRel $categoryRel) : $this
Parameters
- $categoryRel : TCategoryRel
Return values
$thisremoveFileRel()
public
removeFileRel(TFileRel $fileRel) : $this
Parameters
- $fileRel : TFileRel
Return values
$thisremoveParameterRel()
public
removeParameterRel(TParameterRel $parameterRel) : $this
Parameters
- $parameterRel : TParameterRel
Return values
$thissetActivationKey()
public
setActivationKey(string|null $activationKey) : $this
Parameters
- $activationKey : string|null
Return values
$thissetApprovedAt()
public
setApprovedAt(DateTime|null $approvedAt) : $this
Parameters
- $approvedAt : DateTime|null
Return values
$thissetAsset()
public
setAsset(TImage|null $asset) : $this
Parameters
- $asset : TImage|null
Return values
$thissetAssetRels()
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
$thissetBanned()
public
setBanned(bool $banned) : $this
Parameters
- $banned : bool
Return values
$thissetCategoryRels()
public
setCategoryRels(Collection<int, TCategoryRel>|array<int, TCategoryRel> $categoryRels) : $this
Parameters
- $categoryRels : Collection<int, TCategoryRel>|array<int, TCategoryRel>
Return values
$thissetConfirmedAt()
public
setConfirmedAt(DateTime|null $confirmedAt) : $this
Parameters
- $confirmedAt : DateTime|null
Return values
$thissetDeactivated()
public
setDeactivated(bool $deactivated) : $this
Parameters
- $deactivated : bool
Return values
$thissetDeleted()
public
setDeleted(bool $deleted) : $this
Parameters
- $deleted : bool
Return values
$thissetEmail()
public
setEmail(string $email) : $this
Parameters
- $email : string
Return values
$thissetExpirationDate()
public
setExpirationDate(DateTime|null $expirationDate) : $this
Parameters
- $expirationDate : DateTime|null
Return values
$thissetFakeViewsDetail()
public
setFakeViewsDetail(int $fakeViewsDetail) : $this
Parameters
- $fakeViewsDetail : int
Return values
$thissetFakeViewsList()
public
setFakeViewsList(int $fakeViewsList) : $this
Parameters
- $fakeViewsList : int
Return values
$thissetFileRels()
public
setFileRels(Collection<int, TFileRel>|array<int, TFileRel> $fileRels) : $this
Parameters
- $fileRels : Collection<int, TFileRel>|array<int, TFileRel>
Return values
$thissetFollowers()
public
setFollowers(Collection<int, AdvertFollower> $followers) : $this
Parameters
- $followers : Collection<int, AdvertFollower>
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetInsertIp()
public
setInsertIp(string|null $insertIp) : $this
Parameters
- $insertIp : string|null
Return values
$thissetInsertLanguageId()
public
setInsertLanguageId(int|null $insertLanguageId) : $this
Parameters
- $insertLanguageId : int|null
Return values
$thissetInsertLocalizationId()
public
setInsertLocalizationId(int|null $insertLocalizationId) : $this
Parameters
- $insertLocalizationId : int|null
Return values
$thissetInsertUserId()
public
setInsertUserId(int|null $insertUserId) : $this
Parameters
- $insertUserId : int|null
Return values
$thissetManageKeyExpires()
public
setManageKeyExpires(DateTime|null $manageKeyExpires) : $this
Parameters
- $manageKeyExpires : DateTime|null
Return values
$thissetManageKeyHash()
public
setManageKeyHash(string|null $manageKeyHash) : $this
Parameters
- $manageKeyHash : string|null
Return values
$thissetNoticeDeactivation()
public
setNoticeDeactivation(bool $noticeDeactivation) : $this
Parameters
- $noticeDeactivation : bool
Return values
$thissetNoticeExpiration()
public
setNoticeExpiration(bool $noticeExpiration) : $this
Parameters
- $noticeExpiration : bool
Return values
$thissetPaid()
public
setPaid(bool $paid) : $this
Parameters
- $paid : bool
Return values
$thissetParameterRels()
public
setParameterRels(Collection<int, TParameterRel>|array<int, TParameterRel> $parameterRels) : $this
Parameters
- $parameterRels : Collection<int, TParameterRel>|array<int, TParameterRel>
Return values
$thissetPassword()
public
setPassword(string $password) : $this
Parameters
- $password : string
Return values
$thissetPasswordResetExpires()
public
setPasswordResetExpires(DateTime|null $passwordResetExpires) : $this
Parameters
- $passwordResetExpires : DateTime|null
Return values
$thissetPasswordResetHash()
public
setPasswordResetHash(string|null $passwordResetHash) : $this
Parameters
- $passwordResetHash : string|null
Return values
$thissetPrice()
public
setPrice(float|string|null $price) : $this
Parameters
- $price : float|string|null
Return values
$thissetRatingThreadId()
public
setRatingThreadId(int|null $ratingThreadId) : $this
Parameters
- $ratingThreadId : int|null
Return values
$thissetRegion()
public
setRegion(TRegion|null $region) : $this
Parameters
- $region : TRegion|null
Return values
$thissetRegionId()
public
setRegionId(int|null $regionId) : $this
Parameters
- $regionId : int|null
Return values
$thissetRenderBlacklistedWords()
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
$thissetRenderUrlsAllowed()
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
$thissetReported()
public
setReported(bool $reported) : $this
Parameters
- $reported : bool
Return values
$thissetSold()
public
setSold(bool $sold) : $this
Parameters
- $sold : bool
Return values
$thissetTopedUntil()
public
setTopedUntil(DateTime|null $topedUntil) : $this
Parameters
- $topedUntil : DateTime|null
Return values
$thissetUser()
public
setUser(TUser|null $user) : $this
Parameters
- $user : TUser|null
Return values
$thissetViewsDetail()
public
setViewsDetail(int $viewsDetail) : $this
Parameters
- $viewsDetail : int
Return values
$thissetViewsList()
public
setViewsList(int $viewsList) : $this
Parameters
- $viewsList : int
Return values
$thisusesEditor()
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
boolbuildParameterIndex()
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>