original_string: private function validateQuery(SearchQuery $query)
      {
          $indexNames = $this->getIndexNames();
          $queryIndexNames = $query->getIndexes();
  
          foreach ($queryIndexNames as $queryIndexName) {
              if (!in_array($queryIndexName, $indexNames)) {
                  $unknownIndexes[] = $queryIndexName;
              }
          }
  
          if (false === empty($unknownIndexes)) {
              throw new Exception\SearchException(
                  sprintf(
                      'Search indexes "%s" not known. Known indexes: "%s"',
                      implode('", "', $queryIndexNames),
                      implode('", "', $indexNames)
                  )
              );
          }
      }
code: private function validateQuery(SearchQuery $query)
      {
          $indexNames = $this->getIndexNames();
          $queryIndexNames = $query->getIndexes();
  
          foreach ($queryIndexNames as $queryIndexName) {
              if (!in_array($queryIndexName, $indexNames)) {
                  $unknownIndexes[] = $queryIndexName;
              }
          }
  
          if (false === empty($unknownIndexes)) {
              throw new Exception\SearchException(
                  sprintf(
                      'Search indexes "%s" not known. Known indexes: "%s"',
                      implode('", "', $queryIndexNames),
                      implode('", "', $indexNames)
                  )
              );
          }
      }
code_tokens: private function validateQuery ( SearchQuery $ query ) { $ indexNames = $ this -> getIndexNames ( ) ; $ queryIndexNames = $ query -> getIndexes ( ) ; foreach ( $ queryIndexNames as $ queryIndexName ) { if ( ! in_array ( $ queryIndexName , $ indexNames ) ) { $ unknownIndexes [ ] = $ queryIndexName ; } } if ( false === empty ( $ unknownIndexes ) ) { throw new Exception \ SearchException ( sprintf ( 'Search indexes "%s" not known. Known indexes: "%s"' , implode ( '", "' , $ queryIndexNames ) , implode ( '", "' , $ indexNames ) ) ) ; } }
docstring: If query has indexes, ensure that they are known.
  
  @throws Exception\SearchException
  
  @param SearchQuery $query
docstring_tokens: If query has indexes ensure that they are known .