Example #1
0
 public function offsetSet($key, $value)
 {
     $key = $this->filter_key($key);
     if ($key > count($this)) {
         $this->_stack = array_pad($this->_stack, $key, null);
     }
     return parent::offsetSet($key, $value);
 }
Example #2
0
 public function offsetSet($offset, $value)
 {
     if ($this->offsetExists($offset)) {
         $current = $this->offsetGet($offset);
         if (!$current instanceof collection) {
             $current = collection($current);
         }
         $current[] = $value;
         parent::offsetSet($offset, $current);
     }
 }