Hello,
in this document section https://docs.phalcon.io/en/latest/reference/models.html#taking-advantage-of-relationships
shown how to add params
<?php $robotsParts = $robot->getRobotsParts("created_at = '2012-03-15'"); ?>
Is it possible to write in model these params permanently.
I overloaded query function
<?php
class Entity extends \Phalcon\Mvc\Model
{
public static function query($dependencyInjector = NULL)
{
$criteria = parent::query($dependencyInjector);
if (!$criteria->getDI()->get('user')->admin)
$criteria->andWhere('deleted = 0');
return $criteria;
}
}
to always have WHERE deleted=0
on Entity::query() criteria,
but I need to do same if I do $this->user->getEntity().
Do I need to overload __call
method?