Ejemplo n.º 1
0
 /**
  * @param $key
  * @param $value
  *
  * @return $this|null
  * @throws ContextMutabilityError
  */
 public function set($key, $value)
 {
     if (!$this->mutable($key)) {
         throw new ContextMutabilityError("Index `{$key}` is immutable.");
     }
     # attempt writing the value to the key
     if (is_string($key)) {
         list($key, $value) = Arr::expand_notated($key, $value);
         return $this->search([$key => $value]);
     }
     return NULL;
 }
Ejemplo n.º 2
0
 /**
  * @param $key
  * @param $value
  *
  * @return $this|null
  */
 public function set($key, $value)
 {
     # attempt writing the value to the key
     if (is_string($key)) {
         list($key, $value) = Arr::expand_notated($key, $value);
         return $this->search([$key => $value]);
     }
     return NULL;
 }