/** * @param $chartType * @return bool * @throws TypeNotValidException */ public function chartTypeIsValid($chartType) { $validator = new ExistenceValidator(); $validator->setLimits(["Existence" => $this->chartOptions]); $validator->setObject($chartType); return $validator->validate(); }
/** * @param $connectionName * @return bool * @throws ValidationFailedException * @throws \QCharts\CoreBundle\Exception\TypeNotValidException */ public function validateConnection($connectionName) { $validator = new ExistenceValidator(); $validator->setKeyComparison('Connection'); $validator->setLimits(["Connection" => $this->dynamicRepo->getConnectionNames()]); $validator->setObject($connectionName); return $validator->validate(); }