src/Data/TMain.php
public function _getByPath($path)
    {
        $result = null;
        $steps = $this->_pathAsArray($path);
        $depth = count($steps); // number of steps in the path
        if ($depth == 0) {
            $result = $this->data;
        } else {
            $pointer = $this->data;
            $level = 0;
            foreach ($steps as $step) {
                if (is_array($pointer)) {
                    if (isset($pointer[$step])) {
                        /* go to the next step */
                        $pointer = $pointer[$step];
                    } else {
                        /* next step is missed in the path, return null */
                        break;
                    }
                } elseif ($pointer instanceof \Flancer32\Lib\Data) {
                    if (!is_null($pointer->get($step))) {
                        /* go to the next step */
                        $pointer = $pointer->get($step);
                    } else {
                        /* next step is missed in the path, return null */
                        break;
                    }
                } elseif (is_object($pointer)) {
                    if (isset($pointer->$step)) {
                        /* go to the next step */
                        $pointer = $pointer->$step;
                    } else {
                        /* next step is missed in the path, return null */
                        break;
                    }
                } else {
                    /* we have no data for the next step */
                    break;
                }
                $level++; // one step on the path is done
            }
            if ($level >= $depth) {
                /* we have reached the end of path */
                $result = $pointer;
            }
        }
        return $result;
    }
public function _getByPath($path)
    {
        $result = null;
        $steps = $this->_pathAsArray($path);
        $depth = count($steps); // number of steps in the path
        if ($depth == 0) {
            $result = $this->data;
        } else {
            $pointer = $this->data;
            $level = 0;
            foreach ($steps as $step) {
                if (is_array($pointer)) {
                    if (isset($pointer[$step])) {
                        /* go to the next step */
                        $pointer = $pointer[$step];
                    } else {
                        /* next step is missed in the path, return null */
                        break;
                    }
                } elseif ($pointer instanceof \Flancer32\Lib\Data) {
                    if (!is_null($pointer->get($step))) {
                        /* go to the next step */
                        $pointer = $pointer->get($step);
                    } else {
                        /* next step is missed in the path, return null */
                        break;
                    }
                } elseif (is_object($pointer)) {
                    if (isset($pointer->$step)) {
                        /* go to the next step */
                        $pointer = $pointer->$step;
                    } else {
                        /* next step is missed in the path, return null */
                        break;
                    }
                } else {
                    /* we have no data for the next step */
                    break;
                }
                $level++; // one step on the path is done
            }
            if ($level >= $depth) {
                /* we have reached the end of path */
                $result = $pointer;
            }
        }
        return $result;
    }
public function _getByPath ( $ path ) { $ result = null ; $ steps = $ this -> _pathAsArray ( $ path ) ; $ depth = count ( $ steps ) ; // number of steps in the path if ( $ depth == 0 ) { $ result = $ this -> data ; } else { $ pointer = $ this -> data ; $ level = 0 ; foreach ( $ steps as $ step ) { if ( is_array ( $ pointer ) ) { if ( isset ( $ pointer [ $ step ] ) ) { /* go to the next step */ $ pointer = $ pointer [ $ step ] ; } else { /* next step is missed in the path, return null */ break ; } } elseif ( $ pointer instanceof \ Flancer32 \ Lib \ Data ) { if ( ! is_null ( $ pointer -> get ( $ step ) ) ) { /* go to the next step */ $ pointer = $ pointer -> get ( $ step ) ; } else { /* next step is missed in the path, return null */ break ; } } elseif ( is_object ( $ pointer ) ) { if ( isset ( $ pointer -> $ step ) ) { /* go to the next step */ $ pointer = $ pointer -> $ step ; } else { /* next step is missed in the path, return null */ break ; } } else { /* we have no data for the next step */ break ; } $ level ++ ; // one step on the path is done } if ( $ level >= $ depth ) { /* we have reached the end of path */ $ result = $ pointer ; } } return $ result ; }
Recursive method to get some attribute of the DataObject by path.

@param $path
@return array|\Flancer32\Lib\Data|mixed|null
Recursive method to get some attribute of the DataObject by path .