CoolCMS API

UserAssociationOwnerTrait

Implements `OwnerAwareInterface::getOwnerUserId()` for entities that hold the owner only as the `$user` association (`Cart`, `Complaint`, `Order`), without a scalar `userId` column.

The id is read from the identifier of the associated entity. A lazy reference (proxy) already knows its identifier, so the method does not initialize it and runs no database query. Whenever the id cannot be obtained without loading, the result is null.

Table of Contents

Methods

getOwnerUserId()  : int|null

Methods

On this page

Search results