key = DataHelper::checkForEmptyValue($key); $this->setValues($values); } public function getKey() { return $this->key; } /** * @SuppressWarnings(PHPMD.StaticAccess) */ public function addValue($value, $usergroup = null) { if (array_key_exists($usergroup, $this->values)) { throw new DuplicateValueForUsergroupException($this->key, $usergroup); } $this->values[$usergroup] = DataHelper::checkForEmptyValue($value); } protected function setValues($values) { $this->values = []; foreach ($values as $usergroup => $value) { $this->addValue($value, $usergroup); } } public function getAllValues() { return $this->values; } }