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

public __construct ( string $name )
$name string the name of this aggregation
Пример #1
0
 /**
  * @param string      $name
  * @param string|null $bucketsPath
  */
 public function __construct($name, $bucketsPath = null)
 {
     parent::__construct($name);
     if ($bucketsPath !== null) {
         $this->setBucketsPath($bucketsPath);
     }
 }
Пример #2
0
 /**
  * @param string         $name
  * @param AbstractFilter $filter
  */
 public function __construct($name, AbstractFilter $filter = null)
 {
     parent::__construct($name);
     if ($filter !== null) {
         $this->setFilter($filter);
     }
 }
 /**
  * @param string        $name
  * @param AbstractQuery $filter
  */
 public function __construct($name, $filter = null)
 {
     parent::__construct($name);
     if ($filter !== null) {
         if ($filter instanceof AbstractFilter) {
             trigger_error('Deprecated: Elastica\\Aggregation\\Filter passing filter as AbstractFilter is deprecated. Pass instance of AbstractQuery instead.', E_USER_DEPRECATED);
         } elseif (!$filter instanceof AbstractQuery) {
             throw new InvalidException('Filter must be instance of AbstractQuery');
         }
         $this->setFilter($filter);
     }
 }
Пример #4
0
 /**
  * @param string       $name   the name if this aggregation
  * @param string       $field  the field on which to perform this aggregation
  * @param string|array $origin the point from which distances will be calculated
  */
 public function __construct($name, $field, $origin)
 {
     parent::__construct($name);
     $this->setField($field)->setOrigin($origin);
 }
Пример #5
0
 /**
  * @param string $name  the name of this aggregation
  * @param string $field the field on which to perform this aggregation
  */
 public function __construct($name, $field)
 {
     parent::__construct($name);
     $this->setField($field);
 }