AdvertManager
Table of Contents
Traits
- AdvertAssetTrait
- Advert-specific hooks for `AssetProcessingTrait` plus processing of file attachments.
- AdvertEmailTrait
- Transactional e-mails of an advert (confirmation / approval after insert, edit notice).
- AdvertExpirationNoticeTrait
- Cron batch operations on advert expiration.
- AdvertExpirationTrait
- Computes and extends the expiration of an advert (Api layer).
- AdvertFollowerNotificationTrait
- Notifies advert followers about a price change.
- AdvertModerationNoticeTrait
- E-mails the advertiser when the state of the advert changes by someone's decision:
- approval (`approved_at` from NULL to filled, not banned) sends `BZ_ADVERT_ACTIVATION_NOTICE`,
- rejection = ban (`banned` 0 to 1) sends `BZ_ADVERT_BAN`,
- deletion (`deleted` 0 to 1: the owner's "Delete" on the front end, the admin "Deleted" switch)
sends `BZ_ADVERT_DELETE`,
- deactivation (`deactivated` 0 to 1, admin form or grid switch) sends `BZ_ADVERT_DEACTIVATION`.
- AdvertPriceColumnTrait
- Fills the denormalized column `advert.price` from the `price` parameter.
- AdvertRelSyncTrait
- Insert-only sync of advert categories from `meta['categoryIds']` (front/Comcat/simple external
client) in `afterSave`; `paid` is derived server-side from `Category::getForFree()`. Called
on insert only ({@see \App\UI\Api\Bazaar\Models\Managers\AdvertManager::afterSave()}).
- CategoryRelsPaidSanitizationTrait
- Server-side sanitization of `paid` on hydrated `categoryRels` on the external path.