public function findByPids($pids, int $limit = 0, array $querySettings = ['respectSysLanguage' => true]) {
    if (is_string($pids)) {
      $pids = GeneralUtility::intExplode(',', $pids, true);
    }

    if (!empty($pids)) {
      // Create query
      $query = $this->createquery();

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

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

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

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

      return $result;
    }

    return null;
  }
public function findByPids($pids, int $limit = 0, array $querySettings = ['respectSysLanguage' => true]) {
    if (is_string($pids)) {
      $pids = GeneralUtility::intExplode(',', $pids, true);
    }

    if (!empty($pids)) {
      // Create query
      $query = $this->createquery();

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

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

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

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

      return $result;
    }

    return null;
  }
public function findByPids ( $ pids , int $ limit = 0 , array $ querySettings = [ 'respectSysLanguage' => true ] ) { if ( is_string ( $ pids ) ) { $ pids = GeneralUtility :: intExplode ( ',' , $ pids , true ) ; } if ( ! empty ( $ pids ) ) { // Create query $ query = $ this -> createquery ( ) ; // Apply the passed query settings. $ query = $ this -> applyQuerySettings ( $ query , $ querySettings ) ; // Set the query constraints. $ query -> matching ( $ query -> in ( 'pid' , $ pids ) ) ; // 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 multiple PIDs.

@param array|string $pids The PIDs as array or as string, seperated by `,`
@param int $limit The optional limit, defaults to `0`
@param array $querySettings The optional query settings
@return \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult|null The found objects or null if no objects were found
Finds objects by multiple PIDs .