public function __construct(Container $container, array $config = array()) { parent::__construct($container, $config); if ($this->getModel()->getState('limit', 0) != 0) { $this->getModel()->with([]); } }
/** * A mocked object will have a random name, that won't match the regex expression in the parent. * To prevent exceptions, we have to manually set the name * * @return string */ public function getName() { if (isset($this->mockedMethods['getName'])) { $func = $this->mockedMethods['getName']; return call_user_func_array($func, array()); } return parent::getName(); }
/** * Overrides the default display method to add caching support * * @param bool $cachable Is this a cacheable view? * @param bool|array $urlparams Registered URL parameters * @param null|string $tpl Sub-template (not really used...) */ public function display($cachable = false, $urlparams = false, $tpl = null) { $cachable = true; if (!is_array($urlparams)) { $urlparams = []; } $additionalParams = array('option' => 'CMD', 'view' => 'CMD', 'task' => 'CMD', 'format' => 'CMD', 'layout' => 'CMD', 'category_id' => 'INT', 'id' => 'INT', 'dlid' => 'STRING'); $urlparams = array_merge($additionalParams, $urlparams); parent::display($cachable, $urlparams, $tpl); }