/** * Object constructor. Attributes that must conform to a pattern are set * to be single-valued. * * @param string $name Attribute name. * @param boolean $mandatory If the attribute is mandatory/required. * @param string $regexp A PCRE regular expression pattern. * @return self * @throws LogicException RegExp failed the validation test. */ public function __construct($name, $mandatory, $regexp) { parent::__construct($name, $mandatory, AttributeInterface::SINGLE); $this->setRegexp($regexp); }
/** * Object constructor. Attributes with fixed values tend to be single-valued. * * @param string $name Attribute name. * @param boolean $mandatory If the attribute is mandatory/required. * @param array $allowedValues Possible string values for the attribute. * @return self */ public function __construct($name, $mandatory, array $allowedValues) { parent::__construct($name, $mandatory, AttributeInterface::SINGLE); $this->values = $allowedValues; }