Using a Query Container

Edit on GitHub

The query container of the current unterminated query is available via $this->getQueryContainer() in the factory of the communication and the business layer and can be injected into any model.

Query container via factory

Executing the Query

You can adjust the query itself, but you should avoid adding more filters or joins because this is a responsibility of the query container only.

$templateQuery = $this->queryTemplateByPath($path);
$templateCollection = $templateQuery->find(); // or findOne()

You can also change the output format, e.g. to array instead of collection:

$formatter = new SimpleArrayFormatter();