/** * Gets the registered error with the specified message and behaviour * @param $id see FormControlError constants * @return FormControlError */ function getRegisteredError($id) { if ($id instanceof FormControlError) { $id = $id->getValue(); } Assert::hasIndex($this->registeredErrors, $id, '%s error is not registered', $id); return $this->registeredErrors[$id]; }
/** * @param $name * @return IFormControl */ function getControl($name) { Assert::hasIndex($this->controls, $name, 'know nothing about control `%s` within form %s', $name, $this->id); return $this->controls[$name]; }
/** * Gets the label for the custom id * @param $id * @return array */ function getLabelFor($id) { Assert::hasIndex($this->labels, $id, 'unable to find label for %s', $id); return $this->labels[$id]; }
/** * Gets the label for the custom id * @param $id * @return array */ function getLabelFor($value) { Assert::hasIndex($this->options, $value, 'unable to find label for value=%s', $value); return $this->options[$value]; }
/** * Gets the field value * * @param string $name name of the field * @return mixed value of the field */ function getField($name) { Assert::hasIndex($this->fields, $name, 'unknown field %s for %s', $name, get_class($this)); return $this->fields[$name]; }