protected function getParams(BaseHookRenderEvent $event) { $ref = $event->getArgument('ref') ? $event->getArgument('ref') : $this->getView(); $refId = 0; if ($event->getArgument('ref_id')) { $refId = $event->getArgument('ref_id'); } else { if ($this->getRequest()->attributes->has('id')) { $refId = intval($this->getRequest()->attributes->get('id')); } elseif ($this->getRequest()->query->has($ref . '_id')) { $refId = intval($this->getRequest()->query->get($ref . '_id')); } } if (null === $ref || 0 === $refId) { throw new InvalidArgumentException($this->trans("Reference not found", [], Comment::MESSAGE_DOMAIN)); } return [$ref, $refId]; }
public function __construct($code, array $arguments = [], array $fields = []) { parent::__construct($code, $arguments); $this->fragmentBag = new FragmentBag(); $this->fields = $fields; }
public function __construct($code, array $arguments = array()) { parent::__construct($code, $arguments); $this->fragmentBag = new FragmentBag(); }