/** * Executes the validator. * * @param AgaviRequestDataHolder The data which should be validated. * * @return int The validation result (see severity constants). * * @author Uwe Mesecke <*****@*****.**> * @since 0.11.0 */ public function execute(AgaviRequestDataHolder $parameters) { if ($this->getParameter('source') != AgaviRequestDataHolder::SOURCE_PARAMETERS && !in_array($this->getParameter('source'), $parameters->getSourceNames())) { throw new AgaviConfigurationException('Unknown source "' . $this->getParameter('source') . '" specified in validator ' . $this->getName()); } $this->validationParameters = $parameters; $base = new AgaviVirtualArrayPath($this->getParameter('base')); $res = $this->validateInBase($base); if ($this->incident && $this->parentContainer) { $this->parentContainer->addIncident($this->incident); $this->incident = null; } return $res; }