Ejemplo n.º 1
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 = null)
 {
     parent::__construct($name);
     if (!is_null($field)) {
         $this->setField($field);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param string $name the name of this aggregation
  * @param string $field the name of the field on which to perform the aggregation
  * @param int $interval the interval by which documents will be bucketed
  */
 public function __construct($name, $field, $interval)
 {
     parent::__construct($name);
     $this->setField($field);
     $this->setInterval($interval);
 }