public function getPreviousPage($filepath, $entityPath)
    {
        $previousUrl = $previousPage = null;

        foreach ($this->getPages() as $url => $page) {
            if ($filepath == $page['filepath']) {
                if ($previousUrl) {
                    return new ArrayData(
                        array(
                        'Link' => $this->buildUrl($previousUrl),
                        'Title' => $previousPage['title']
                        )
                    );
                }
            }

            if (strpos($page['filepath'], $entityPath) !== false) {
                $previousUrl = $url;
                $previousPage = $page;
            }
        }

        return null;
    }
public function getPreviousPage($filepath, $entityPath)
    {
        $previousUrl = $previousPage = null;

        foreach ($this->getPages() as $url => $page) {
            if ($filepath == $page['filepath']) {
                if ($previousUrl) {
                    return new ArrayData(
                        array(
                        'Link' => $this->buildUrl($previousUrl),
                        'Title' => $previousPage['title']
                        )
                    );
                }
            }

            if (strpos($page['filepath'], $entityPath) !== false) {
                $previousUrl = $url;
                $previousPage = $page;
            }
        }

        return null;
    }
public function getPreviousPage ( $ filepath , $ entityPath ) { $ previousUrl = $ previousPage = null ; foreach ( $ this -> getPages ( ) as $ url => $ page ) { if ( $ filepath == $ page [ 'filepath' ] ) { if ( $ previousUrl ) { return new ArrayData ( array ( 'Link' => $ this -> buildUrl ( $ previousUrl ) , 'Title' => $ previousPage [ 'title' ] ) ) ; } } if ( strpos ( $ page [ 'filepath' ] , $ entityPath ) !== false ) { $ previousUrl = $ url ; $ previousPage = $ page ; } } return null ; }
Determine the previous page from the given page.

Relies on the fact when the manifest was built, it was generated in
order.

@param string $filepath
@param string $entityBase

@return ArrayData
Determine the previous page from the given page .