original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Determine the previous page from the given page .