public function findByPid(int $pid, int $limit = 0, array $querySettings = ['respectSysLanguage' => true]) {
    if ($pid && $pid > 0) {
      // Create a new query.
      $query = $this->createquery();

      // Apply the passed query settings.
      $query = $this->applyQuerySettings($query, $querySettings);

      // Set the query constraints.
      $query->matching($query->equals('pid', $pid));

      // Set the query limit if available.
      if ($limit > 0) {
        $query->setLimit($limit);
      }

      // Execute the query.
      $result = $query->execute();

      return $result;
    }

    return null;
  }
public function findByPid(int $pid, int $limit = 0, array $querySettings = ['respectSysLanguage' => true]) {
    if ($pid && $pid > 0) {
      // Create a new query.
      $query = $this->createquery();

      // Apply the passed query settings.
      $query = $this->applyQuerySettings($query, $querySettings);

      // Set the query constraints.
      $query->matching($query->equals('pid', $pid));

      // Set the query limit if available.
      if ($limit > 0) {
        $query->setLimit($limit);
      }

      // Execute the query.
      $result = $query->execute();

      return $result;
    }

    return null;
  }
public function findByPid ( int $ pid , int $ limit = 0 , array $ querySettings = [ 'respectSysLanguage' => true ] ) { if ( $ pid && $ pid > 0 ) { // Create a new query. $ query = $ this -> createquery ( ) ; // Apply the passed query settings. $ query = $ this -> applyQuerySettings ( $ query , $ querySettings ) ; // Set the query constraints. $ query -> matching ( $ query -> equals ( 'pid' , $ pid ) ) ; // Set the query limit if available. if ( $ limit > 0 ) { $ query -> setLimit ( $ limit ) ; } // Execute the query. $ result = $ query -> execute ( ) ; return $ result ; } return null ; }
Finds objects by PID.

@param int $pid The PID
@param int $limit The optional limit, defaults to `0`
@param array $querySettings The optional query settings to apply
@return \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult|null The found objects or null if no objects were found
Finds objects by PID .