Doctrine\MongoDB\Aggregation\Builder::__construct PHP Method

__construct() public method

Create a new aggregation builder.
public __construct ( Doctrine\MongoDB\Collection $collection )
$collection Doctrine\MongoDB\Collection
    public function __construct(Collection $collection)
    {
        $this->collection = $collection;
    }

Usage Example

Example #1
0
 /**
  * Create a new aggregation builder.
  *
  * @param DocumentManager $dm
  * @param string $documentName
  */
 public function __construct(DocumentManager $dm, $documentName)
 {
     $this->dm = $dm;
     $this->class = $this->dm->getClassMetadata($documentName);
     parent::__construct($this->dm->getDocumentCollection($documentName));
 }