Пример #1
0
 /**
  * @param Attribute $attribute
  */
 public function add(Attribute $attribute)
 {
     if ($this->mode === 'create' && $attribute->hasFlag('hide_add')) {
         return;
     }
     $this->attributes->push($attribute);
 }
 /**
  * @param string $name
  * @param string $format
  * @param array  $flags
  */
 public function __construct($name, $format = '', $flags = [])
 {
     if (!$format) {
         $className = get_class($this);
         throw new MissingArgumentException("Missing argument [format] in [{$className}]");
     }
     $this->format = $format;
     parent::__construct($name, $flags);
 }
 /**
  * @param string $name
  * @param array  $value
  * @param array  $flags
  */
 public function __construct($name, $value, array $flags = [])
 {
     $this->value = $value;
     parent::__construct($name, $flags);
 }