'Please do not use the same names' ); function __construct(array $options) { if ($options instanceof Zend_Config) { $options = $options->toArray(); } else if (!is_array($options)) { throw new Exception('Invalid options'); } if (!array_key_exists('data', $options)) { throw new Exception('Data is undefined'); } $this->setDataValues($options['data']); if (isset($options['additionalValues']) && $options['additionalValues']) { $this->setAdditionalValues($options['additionalValues']); } } /** * @param array $data * @return $this */ public function setAdditionalValues($data) { $this->_additionalValues = $data; return $this; } /** * @return mixed */ public function getAdditionalValues() { return $this->_additionalValues; } /** * @param array $data * @return $this */ public function setDataValues($data) { $this->_data = $data; return $this; } /** * @return mixed */ public function getDataValues() { return $this->_data; } public function isValid($value) { $values = array_merge($this->getDataValues(), $this->getAdditionalValues()); if ($values) { $applicants = array_filter(array_map('strtolower', array_map('trim', $values))); if (count($applicants) != count(array_unique($applicants))) { $this->_error(Qs_Translate::translate(self::NOT_UNIQUE)); return false; } } return true; } }