/** * {@inheritdoc} */ public function add(OverrideInterface $override) { if (null === ($template = $override->getTemplate())) { throw new \InvalidArgumentException('Override needs to have a template defined.'); } if (!array_key_exists($template, $this->overrides)) { $this->overrides[$template] = array(); } $this->overrides[$template][] = $override; }