BuildAdvertTrait
Builds the Advert entity from submitted values: the entity's own columns (password, IP, user, language, email, region, expiration). `categoryRels` is not populated; it is passed through meta in `processSubmit()` (as in the Discussion pattern), because the hydrator would fail on a newly created advert (id=null) generating the reference key for the association PK of the rel entities.
parameterRels is an owned collection and the insert path is solved (back-reference from
the owner), so AdvertForm::processSubmit() populates it directly on $advert
(see applyParameterRels()), also on a newly created advert from this trait.
Table of Contents
Methods
- buildAdvert() : Advert
- Builds the Advert entity from submitted values. Public: the consumer (or {@see \App\UI\Front\Comcat\Components\AdvertFormComponent\AdvertForm::processSubmit()}) uses it to get a fully prepared entity without persistence.
- setExpirationDate() : void
Methods
buildAdvert()
Builds the Advert entity from submitted values. Public: the consumer (or {@see \App\UI\Front\Comcat\Components\AdvertFormComponent\AdvertForm::processSubmit()}) uses it to get a fully prepared entity without persistence.
public
buildAdvert(ArrayHash $values[, string|null $passwordHash = null ]) : Advert
Parameters
- $values : ArrayHash
- $passwordHash : string|null = null
Return values
AdvertsetExpirationDate()
private
setExpirationDate(Advert $advert) : void
Parameters
- $advert : Advert