validate($properties); $this->properties = $properties; } /** * @param $properties * @throws \common_exception_ValidationFailed */ protected function validate($properties) { $validatedProperties = array_keys($this->getProperties()); foreach ($properties as $key => $value) { if (!in_array($key, $validatedProperties, false)) { throw new \common_exception_ValidationFailed($key); } } } }