/** * @param string $name * @param string|null $bucketsPath */ public function __construct($name, $bucketsPath = null) { parent::__construct($name); if ($bucketsPath !== null) { $this->setBucketsPath($bucketsPath); } }
/** * @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); } }
/** * @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); }
/** * @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); }