classes/Map.php
public function & find($path, $create=false, callable $operation=null) {
        $create ? $value =& $this->fields : $value = $this->fields;
        foreach (explode('.',$path) as $tok) if ($create || isset($value[$tok])) {
          $value =& $value[$tok];
        } else {
          $value = $create ? $value :  null;  break;
        }
        if ( is_callable($operation) ) $operation($value);
        return $value;
    }
public function & find($path, $create=false, callable $operation=null) {
        $create ? $value =& $this->fields : $value = $this->fields;
        foreach (explode('.',$path) as $tok) if ($create || isset($value[$tok])) {
          $value =& $value[$tok];
        } else {
          $value = $create ? $value :  null;  break;
        }
        if ( is_callable($operation) ) $operation($value);
        return $value;
    }
public function & find ( $ path , $ create = false , callable $ operation = null ) { $ create ? $ value = & $ this -> fields : $ value = $ this -> fields ; foreach ( explode ( '.' , $ path ) as $ tok ) if ( $ create || isset ( $ value [ $ tok ] ) ) { $ value = & $ value [ $ tok ] ; } else { $ value = $ create ? $ value : null ; break ; } if ( is_callable ( $ operation ) ) $ operation ( $ value ) ; return $ value ; }
Navigate map and find the element from the path in dot notation.
@param  string  $path Key path in dot notation.
@param  boolean $create If true will create empty paths.
@param  callable  If passed this callback will be applied to the founded value.
@return mixed The founded value.
Navigate map and find the element from the path in dot notation .