original_string: public function getChildrenFor($entityPath, $recordPath = null)
      {
          if (!$recordPath) {
              $recordPath = $entityPath;
          }
  
          $output = new ArrayList();
          $entityPath = $this->normalizeUrl($entityPath);
          $recordPath = $this->normalizeUrl($recordPath);
          $recordParts = explode('/', trim($recordPath, '/'));
          $currentRecordPath = end($recordParts);
          $depth = substr_count($entityPath, '/');
  
          foreach ($this->getPages() as $url => $page) {
              $pagePath = $this->normalizeUrl($page['filepath']);
  
              // check to see if this page is under the given path
              if (strpos($pagePath, $entityPath) === false) {
                  continue;
              }
  
              // only pull it up if it's one more level depth
              if (substr_count($pagePath, '/') == ($depth + 1)) {
                  $pagePathParts = explode('/', trim($pagePath, '/'));
                  $currentPagePath = end($pagePathParts);
                  if ($currentPagePath == $currentRecordPath) {
                      $mode = 'current';
                  } elseif (strpos($recordPath, $pagePath) !== false) {
                      $mode = 'section';
                  } else {
                      $mode = 'link';
                  }
  
                  $children = new ArrayList();
  
                  if ($mode == 'section' || $mode == 'current') {
                      $children = $this->getChildrenFor($pagePath, $recordPath);
                  }
  
                  $output->push(
                      new ArrayData(
                          array(
                          'Link' => $this->buildUrl($url),
                          'Title' => $page['title'],
                          'LinkingMode' => $mode,
                          'Summary' => $page['summary'],
                          'Children' => $children
                          )
                      )
                  );
              }
          }
  
          return $output;
      }
code: public function getChildrenFor($entityPath, $recordPath = null)
      {
          if (!$recordPath) {
              $recordPath = $entityPath;
          }
  
          $output = new ArrayList();
          $entityPath = $this->normalizeUrl($entityPath);
          $recordPath = $this->normalizeUrl($recordPath);
          $recordParts = explode('/', trim($recordPath, '/'));
          $currentRecordPath = end($recordParts);
          $depth = substr_count($entityPath, '/');
  
          foreach ($this->getPages() as $url => $page) {
              $pagePath = $this->normalizeUrl($page['filepath']);
  
              // check to see if this page is under the given path
              if (strpos($pagePath, $entityPath) === false) {
                  continue;
              }
  
              // only pull it up if it's one more level depth
              if (substr_count($pagePath, '/') == ($depth + 1)) {
                  $pagePathParts = explode('/', trim($pagePath, '/'));
                  $currentPagePath = end($pagePathParts);
                  if ($currentPagePath == $currentRecordPath) {
                      $mode = 'current';
                  } elseif (strpos($recordPath, $pagePath) !== false) {
                      $mode = 'section';
                  } else {
                      $mode = 'link';
                  }
  
                  $children = new ArrayList();
  
                  if ($mode == 'section' || $mode == 'current') {
                      $children = $this->getChildrenFor($pagePath, $recordPath);
                  }
  
                  $output->push(
                      new ArrayData(
                          array(
                          'Link' => $this->buildUrl($url),
                          'Title' => $page['title'],
                          'LinkingMode' => $mode,
                          'Summary' => $page['summary'],
                          'Children' => $children
                          )
                      )
                  );
              }
          }
  
          return $output;
      }
code_tokens: public function getChildrenFor ( $ entityPath , $ recordPath = null ) { if ( ! $ recordPath ) { $ recordPath = $ entityPath ; } $ output = new ArrayList ( ) ; $ entityPath = $ this -> normalizeUrl ( $ entityPath ) ; $ recordPath = $ this -> normalizeUrl ( $ recordPath ) ; $ recordParts = explode ( '/' , trim ( $ recordPath , '/' ) ) ; $ currentRecordPath = end ( $ recordParts ) ; $ depth = substr_count ( $ entityPath , '/' ) ; foreach ( $ this -> getPages ( ) as $ url => $ page ) { $ pagePath = $ this -> normalizeUrl ( $ page [ 'filepath' ] ) ; // check to see if this page is under the given path if ( strpos ( $ pagePath , $ entityPath ) === false ) { continue ; } // only pull it up if it's one more level depth if ( substr_count ( $ pagePath , '/' ) == ( $ depth + 1 ) ) { $ pagePathParts = explode ( '/' , trim ( $ pagePath , '/' ) ) ; $ currentPagePath = end ( $ pagePathParts ) ; if ( $ currentPagePath == $ currentRecordPath ) { $ mode = 'current' ; } elseif ( strpos ( $ recordPath , $ pagePath ) !== false ) { $ mode = 'section' ; } else { $ mode = 'link' ; } $ children = new ArrayList ( ) ; if ( $ mode == 'section' || $ mode == 'current' ) { $ children = $ this -> getChildrenFor ( $ pagePath , $ recordPath ) ; } $ output -> push ( new ArrayData ( array ( 'Link' => $ this -> buildUrl ( $ url ) , 'Title' => $ page [ 'title' ] , 'LinkingMode' => $ mode , 'Summary' => $ page [ 'summary' ] , 'Children' => $ children ) ) ) ; } } return $ output ; }
docstring: Return the children of the provided record path.
  
  Looks for any pages in the manifest which have one more slash attached.
  
  @param string $path
  
  @return ArrayList
docstring_tokens: Return the children of the provided record path .