original_string: public function getNextPage($filepath, $entityBase)
      {
          $grabNext = false;
          $fallback = null;
  
          foreach ($this->getPages() as $url => $page) {
              if ($grabNext && strpos($page['filepath'], $entityBase) !== false) {
                  return new ArrayData(
                      array(
                      'Link' => $this->buildUrl($url),
                      'Title' => $page['title']
                      )
                  );
              }
  
              if ($filepath == $page['filepath']) {
                  $grabNext = true;
              } elseif (!$fallback && strpos($page['filepath'], $filepath) !== false) {
                  $fallback = new ArrayData(
                      array(
                      'Link' => $this->buildUrl($url),
                      'Title' => $page['title'],
                      'Fallback' => true
                      )
                  );
              }
          }
  
          if (!$grabNext) {
              return $fallback;
          }
  
          return null;
      }
code: public function getNextPage($filepath, $entityBase)
      {
          $grabNext = false;
          $fallback = null;
  
          foreach ($this->getPages() as $url => $page) {
              if ($grabNext && strpos($page['filepath'], $entityBase) !== false) {
                  return new ArrayData(
                      array(
                      'Link' => $this->buildUrl($url),
                      'Title' => $page['title']
                      )
                  );
              }
  
              if ($filepath == $page['filepath']) {
                  $grabNext = true;
              } elseif (!$fallback && strpos($page['filepath'], $filepath) !== false) {
                  $fallback = new ArrayData(
                      array(
                      'Link' => $this->buildUrl($url),
                      'Title' => $page['title'],
                      'Fallback' => true
                      )
                  );
              }
          }
  
          if (!$grabNext) {
              return $fallback;
          }
  
          return null;
      }
code_tokens: public function getNextPage ( $ filepath , $ entityBase ) { $ grabNext = false ; $ fallback = null ; foreach ( $ this -> getPages ( ) as $ url => $ page ) { if ( $ grabNext && strpos ( $ page [ 'filepath' ] , $ entityBase ) !== false ) { return new ArrayData ( array ( 'Link' => $ this -> buildUrl ( $ url ) , 'Title' => $ page [ 'title' ] ) ) ; } if ( $ filepath == $ page [ 'filepath' ] ) { $ grabNext = true ; } elseif ( ! $ fallback && strpos ( $ page [ 'filepath' ] , $ filepath ) !== false ) { $ fallback = new ArrayData ( array ( 'Link' => $ this -> buildUrl ( $ url ) , 'Title' => $ page [ 'title' ] , 'Fallback' => true ) ) ; } } if ( ! $ grabNext ) { return $ fallback ; } return null ; }
docstring: Determine the next 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 next page from the given page .