/** * Gets a label by field name. * * @param string $name The field name (required - the default value is here because PHP do not allow signature changes with inheritance) * * @return string The label name or an empty string if it is not defined */ public function getLabel($name = null) { if (1 == func_num_args()) { if (!isset($this->fields[$name])) { throw new InvalidArgumentException(sprintf('Unable to get the label on an unexistant widget ("%s").', $name)); } return $this->fields[$name]->getLabel(); } else { // label for this widget schema return parent::getLabel(); } }