public function getChild($path)
    {
        if (is_string($path)) {
            $path = explode('/', $path);
        }
        $remaining = array_splice($path, 1, count($path) - 1);

        foreach ($this->childItems as $childItem) {
            if ($childItem->getId() == $path[0]) {
                if (empty($remaining)) {
                    return $childItem;
                } elseif ($childItem instanceof ParentItem) {
                    return $childItem->getChild($remaining);
                } else {
                    return null;
                }
            }
        }

        return null;
    }
public function getChild($path)
    {
        if (is_string($path)) {
            $path = explode('/', $path);
        }
        $remaining = array_splice($path, 1, count($path) - 1);

        foreach ($this->childItems as $childItem) {
            if ($childItem->getId() == $path[0]) {
                if (empty($remaining)) {
                    return $childItem;
                } elseif ($childItem instanceof ParentItem) {
                    return $childItem->getChild($remaining);
                } else {
                    return null;
                }
            }
        }

        return null;
    }
public function getChild ( $ path ) { if ( is_string ( $ path ) ) { $ path = explode ( '/' , $ path ) ; } $ remaining = array_splice ( $ path , 1 , count ( $ path ) - 1 ) ; foreach ( $ this -> childItems as $ childItem ) { if ( $ childItem -> getId ( ) == $ path [ 0 ] ) { if ( empty ( $ remaining ) ) { return $ childItem ; } elseif ( $ childItem instanceof ParentItem ) { return $ childItem -> getChild ( $ remaining ) ; } else { return null ; } } } return null ; }
Get child element from path py searching recursiveley.

@param $path

@return ItemInterface|null
Get child element from path py searching recursiveley .