Skip to content

With

  • Full name: \Zemit\Mvc\Controller\Traits\Query\With

Properties

with

protected ?\Phalcon\Support\Collection $with

Methods

initializeWith

Initializes the relationships.

public initializeWith(): void

This method is responsible for initializing the allowed relationship aliases.


setWith

Sets the allowed relationship aliases.

public setWith(\Phalcon\Support\Collection|null $with): void

Parameters:

Parameter Type Description
$with **\Phalcon\Support\Collection null**

getWith

Returns the relationship aliases collection.

public getWith(): \Phalcon\Support\Collection|null

This method retrieves the allowed relationship aliases for the model. If with fields have been set, it returns the collection of relationship aliases. If no relationship aliases have been set, it returns null.

Note: The relationship aliases are the fields that are allowed to retrieve during queries.

Return Value:

The collection of relationship aliases or null everything is allowed.