public function add(Option $option) { if (!isset($this->pairs[$option->getKey()])) { $this->pairs[$option->getKey()] = $option; return true; } return false; }
/** * @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; } }