/** * @see Collection::aggregate() */ public function aggregate(array $pipeline, array $options = array()) { if (!array_key_exists(0, $pipeline)) { $pipeline = func_get_args(); $options = array(); } $this->log(array('aggregate' => true, 'pipeline' => $pipeline, 'options' => $options)); return parent::aggregate($pipeline, $options); }
/** * Executes the aggregation pipeline * * @param array $options * @return Iterator */ public function execute($options = array()) { return $this->collection->aggregate($this->getPipeline(), $options); }