CoolCMS API

InitTrait

Table of Contents

Methods

attachGroupImages()  : void
Loads group photos (`imageId` to `Asset`, may be missing) into the `image` key.
prepareGroups()  : void
Builds the group-to-items structure by `serviceGroupId`.

Methods

attachGroupImages()

Loads group photos (`imageId` to `Asset`, may be missing) into the `image` key.

private attachGroupImages(array<int, Service>}> &$groups) : void

The entity carries only the foreign key. One IN query covers all filtered groups.

Parameters
$groups : array<int, Service>}>

prepareGroups()

Builds the group-to-items structure by `serviceGroupId`.

private prepareGroups() : void

Service has no ORM association to ServiceGroup (see ServicePresenter::internalActionPublicList()). Groups and items arrive from the Api already sorted by their own order; they are only joined here. An empty group (all items filtered out by the server as non-public) is not rendered, because a heading without items would be confusing.

On this page

Search results