/** * {@inheritdoc} */ public function offsetSet($offset, $value) { //Add the child to the parent if ($this->parent) { $this->parent->offsetSet($offset, $value); } //Add child to itself parent::offsetSet($offset, $value); }
public function offsetSet($offset, $value) { if ($value instanceof Option) { $value->attr('value', $offset); } else { $value = Option::create($offset, $value); } parent::offsetSet($offset, $value); }