Пример #1
0
 private function addProperty(AbstractProperty $p)
 {
     if (!$p->hasName() || $p->isEmpty()) {
         throw new IllegalArgumentException("The Property to add has no name of is empty");
     }
     if (array_key_exists($p->name(), $this->set)) {
         throw new IllegalArgumentException("A Property with the same name \"{$p->name()}\" already exists in the property \"{$this->name()}\"");
     }
     if ($this->set == null) {
         $this->set = array();
     }
     $this->set[$p->name()] = $p;
 }
Пример #2
0
 public function __construct($name, $value = null)
 {
     parent::__construct($name);
     $this->value = $value;
 }