getTypes() публичный Метод

Return array of types.
public getTypes ( ) : array
Результат array List of types
Пример #1
0
 public function testAddTypes()
 {
     $client = $this->_getClient();
     $search = new Search($client);
     $index = $this->_createIndex();
     $types = array();
     $types[] = $index->getType('type1');
     $types[] = $index->getType('type2');
     $search->addTypes($types);
     $this->assertEquals(2, count($search->getTypes()));
 }
Пример #2
0
 /**
  * @param  \Elastica\Search $search
  * @return array
  */
 protected function _getSearchDataHeader(BaseSearch $search)
 {
     $header = $search->getOptions();
     if ($search->hasIndices()) {
         $header['index'] = $search->getIndices();
     }
     if ($search->hasTypes()) {
         $header['types'] = $search->getTypes();
     }
     return $header;
 }
Пример #3
0
 /**
  * @param \Elastica\Search $search
  *
  * @return array
  */
 protected function _getSearchDataHeader(BaseSearch $search)
 {
     $header = $search->getOptions();
     if ($search->hasIndices()) {
         $header['index'] = $search->getIndices();
     }
     if ($search->hasTypes()) {
         $header['types'] = $search->getTypes();
     }
     // Filter options accepted in the "header"
     return array_intersect_key($header, array_flip(self::$HEADER_OPTIONS));
 }