src/Store/Document.php
public function set($key, $value)
    {
        Assume::that(is_scalar($key));
        if (isset($this->emptySubset)) {
            $this->createTrueSubset();
        }
        $oldValue = null;
        if (isset($this->data[$key])) {
            $oldValue = $this->data[$key];
        }
        if (isset($key) and isset($value) and $key !== '') {
            $this->data[$key] = $value;
        } else {
            $this->data[$key] = null;
        }
        if (! $this->root->updated and $oldValue !== $value) {
            $this->root->updated = true;
            $this->root->update();
        }
    }
public function set($key, $value)
    {
        Assume::that(is_scalar($key));
        if (isset($this->emptySubset)) {
            $this->createTrueSubset();
        }
        $oldValue = null;
        if (isset($this->data[$key])) {
            $oldValue = $this->data[$key];
        }
        if (isset($key) and isset($value) and $key !== '') {
            $this->data[$key] = $value;
        } else {
            $this->data[$key] = null;
        }
        if (! $this->root->updated and $oldValue !== $value) {
            $this->root->updated = true;
            $this->root->update();
        }
    }
public function set ( $ key , $ value ) { Assume :: that ( is_scalar ( $ key ) ) ; if ( isset ( $ this -> emptySubset ) ) { $ this -> createTrueSubset ( ) ; } $ oldValue = null ; if ( isset ( $ this -> data [ $ key ] ) ) { $ oldValue = $ this -> data [ $ key ] ; } if ( isset ( $ key ) and isset ( $ value ) and $ key !== '' ) { $ this -> data [ $ key ] = $ value ; } else { $ this -> data [ $ key ] = null ; } if ( ! $ this -> root -> updated and $ oldValue !== $ value ) { $ this -> root -> updated = true ; $ this -> root -> update ( ) ; } }
Update a document key.

@param string $key
The document key to access.
@param mixed $value
The value to associate with the key.
Update a document key .