부터: 1.2
저자: alcaeus (alcaeus@alcaeus.org)
예제 #1
0
파일: Sort.php 프로젝트: alcaeus/mongodb
 /**
  * @param Builder $builder
  * @param array|string $fieldName Field name or array of field/order pairs
  * @param int|string $order       Field order (if one field is specified)
  */
 public function __construct(Builder $builder, $fieldName, $order = null)
 {
     parent::__construct($builder);
     $allowedMetaSort = ['textScore'];
     $fields = is_array($fieldName) ? $fieldName : [$fieldName => $order];
     foreach ($fields as $fieldName => $order) {
         if (is_string($order)) {
             if (in_array($order, $allowedMetaSort)) {
                 $order = ['$meta' => $order];
             } else {
                 $order = strtolower($order) === 'asc' ? 1 : -1;
             }
         }
         $this->sort[$fieldName] = $order;
     }
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function __construct(Builder $builder)
 {
     $this->expr = new Expr();
     parent::__construct($builder);
 }
예제 #3
0
파일: Out.php 프로젝트: alcaeus/mongodb
 /**
  * @param Builder $builder
  * @param string $collection
  */
 public function __construct(Builder $builder, $collection)
 {
     parent::__construct($builder);
     $this->collection = $collection;
 }
예제 #4
0
파일: Unwind.php 프로젝트: Wizkunde/mongodb
 /**
  * @param Builder $builder
  * @param string $fieldName
  */
 public function __construct(Builder $builder, $fieldName)
 {
     parent::__construct($builder);
     $this->fieldName = (string) $fieldName;
 }
예제 #5
0
파일: Limit.php 프로젝트: Wizkunde/mongodb
 /**
  * @param Builder $builder
  * @param integer $limit
  */
 public function __construct(Builder $builder, $limit)
 {
     parent::__construct($builder);
     $this->limit = (int) $limit;
 }
예제 #6
0
파일: Match.php 프로젝트: doctrine/mongodb
 /**
  * {@inheritdoc}
  */
 public function __construct(Builder $builder)
 {
     parent::__construct($builder);
     $this->query = $this->expr();
 }
예제 #7
0
 /**
  * Lookup constructor.
  *
  * @param Builder $builder
  * @param string $from
  */
 public function __construct(Builder $builder, $from)
 {
     parent::__construct($builder);
     $this->from($from);
 }
예제 #8
0
파일: Skip.php 프로젝트: malukenho/mongodb
 /**
  * @param Builder $builder
  * @param integer $skip
  */
 public function __construct(Builder $builder, $skip)
 {
     parent::__construct($builder);
     $this->skip = (int) $skip;
 }
예제 #9
0
 /**
  * @param Builder $builder
  * @param integer $size
  */
 public function __construct(Builder $builder, $size)
 {
     parent::__construct($builder);
     $this->size = (int) $size;
 }