Пример #1
0
 public function add(Option $option)
 {
     if (!isset($this->pairs[$option->getKey()])) {
         $this->pairs[$option->getKey()] = $option;
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * @param Option $option
  */
 public function add(Option $option)
 {
     if ($this->initialized) {
         $old = $this->pairs[$option->getKey()];
         $option->setValue($old->getValue());
         $this->pairs[$option->getKey()] = $option;
     } else {
         $this->pairs[$option->getKey()] = $option;
     }
 }