src/Store/Document.php
public function get($key, $default = null)
    {
        if (isset($this->data[$key])) {
            $value = $this->data[$key];
        } else {
            if (isset($default)) {
                $this->setDefault($key, $default);
            } elseif (isset($this->defaultData[$key])) {
                $default = $this->defaultData[$key];
            }
            return $default;
        }
        if (isset($default)) {
            if (gettype($default) !== gettype($value)) {
                $this->setDefault($key, $default);
                return $default;
            }
        }
        return $value;
    }
public function get($key, $default = null)
    {
        if (isset($this->data[$key])) {
            $value = $this->data[$key];
        } else {
            if (isset($default)) {
                $this->setDefault($key, $default);
            } elseif (isset($this->defaultData[$key])) {
                $default = $this->defaultData[$key];
            }
            return $default;
        }
        if (isset($default)) {
            if (gettype($default) !== gettype($value)) {
                $this->setDefault($key, $default);
                return $default;
            }
        }
        return $value;
    }
public function get ( $ key , $ default = null ) { if ( isset ( $ this -> data [ $ key ] ) ) { $ value = $ this -> data [ $ key ] ; } else { if ( isset ( $ default ) ) { $ this -> setDefault ( $ key , $ default ) ; } elseif ( isset ( $ this -> defaultData [ $ key ] ) ) { $ default = $ this -> defaultData [ $ key ] ; } return $ default ; } if ( isset ( $ default ) ) { if ( gettype ( $ default ) !== gettype ( $ value ) ) { $ this -> setDefault ( $ key , $ default ) ; return $ default ; } } return $ value ; }
Retreive value of a document key.
Returns the default value if
the key is not found or if the type of the found value does not match the
type of the defuault value.

@param string $key
Document key.
@param mixed $default
Optional default value.
@return mixed Content of document key.
Retreive value of a document key . Returns the default value if the key is not found or if the type of the found value does not match the type of the defuault value .