public function getSubpages(int $pid, int $recursion = 1, bool $exclude = true, int $languageUid = null): array {
    $subpages     = [];
    $subpagesUids = $this->getSubpagesUids($pid, $recursion, $exclude);

    if ($subpagesUids) {
      foreach ($subpagesUids as $subpageUid) {
        $record = $this->getPage($subpageUid, $languageUid);

        if ($record) {
          $subpages[] = $record;
        }
      }
    }

    return $subpages;
  }
public function getSubpages(int $pid, int $recursion = 1, bool $exclude = true, int $languageUid = null): array {
    $subpages     = [];
    $subpagesUids = $this->getSubpagesUids($pid, $recursion, $exclude);

    if ($subpagesUids) {
      foreach ($subpagesUids as $subpageUid) {
        $record = $this->getPage($subpageUid, $languageUid);

        if ($record) {
          $subpages[] = $record;
        }
      }
    }

    return $subpages;
  }
public function getSubpages ( int $ pid , int $ recursion = 1 , bool $ exclude = true , int $ languageUid = null ) : array { $ subpages = [ ] ; $ subpagesUids = $ this -> getSubpagesUids ( $ pid , $ recursion , $ exclude ) ; if ( $ subpagesUids ) { foreach ( $ subpagesUids as $ subpageUid ) { $ record = $ this -> getPage ( $ subpageUid , $ languageUid ) ; if ( $ record ) { $ subpages [ ] = $ record ; } } } return $ subpages ; }
Gets the subpages of a page.

@param int $pid The PID of the entry page to search from
@param int $recursion The recursion, defaults to `1`
@param bool $exclude If set, the entry page should be excluded, defaults to `true`
@param int $languageUid The optional language UID, defaults to the UID of the current system language
@return array The subpages or empty if no subpages were found
Gets the subpages of a page .