CoolCMS API

InitRenderTrait

Table of Contents

Methods

initializeRender()  : void
prepareAdvertFilters()  : array<int, BaseFilter>
Visibility conditions of the list.

Methods

initializeRender()

private initializeRender([int $maxNumber = 6 ]) : void
Parameters
$maxNumber : int = 6

prepareAdvertFilters()

Visibility conditions of the list.

private prepareAdvertFilters() : array<int, BaseFilter>

The same logic as TopAdvertList: when the presenter has prepareFilters(), it is used (respects category, region and rights). Otherwise a safe default set applies, deliberately fail-closed, so that a deleted, banned or unpaid company profile never reaches the home page.

IMPORTANT: no sold. This set was copied from Bazaar, which has "sold", but Comcat\Advert is a company profile and has no such column. Doctrine does not notice at build time, only at runtime, and crashes the whole page:

QueryException: [Semantical Error] ... near 'sold = :filter_5':
Class App\UI\Api\Comcat\Models\Entities\Advert has no field
or association named sold

TopAdvertListComponent does not have this error, its set does not contain sold; see AdvertDocumentSource, which describes the difference between the two definitions of an "active advert".

Return values
array<int, BaseFilter>
On this page

Search results