Doctrine\MongoDB\Query\Builder::addOr PHP 메소드

addOr() 공개 메소드

You can create a new expression using the {@link Builder::expr()} method.
또한 보기: Expr::addOr()
또한 보기: http://docs.mongodb.org/manual/reference/operator/or/
public addOr ( array | Expr $expression )
$expression array | Expr
    public function addOr($expression)
    {
        $this->expr->addOr(...func_get_args());
        return $this;
    }

Usage Example

 /**
  * Apply the query part to search for product where the completenesses
  * are missing. Apply only to the channel or product if provided.
  *
  * @param Builder          $productsQb
  * @param ProductInterface $product
  * @param ChannelInterface $channel
  */
 protected function applyFindMissingQuery(Builder $productsQb, ProductInterface $product = null, ChannelInterface $channel = null)
 {
     if (null !== $product) {
         $productsQb->field('_id')->equals($product->getId());
     } else {
         $combinations = $this->getChannelLocaleCombinations($channel);
         if (!empty($combinations)) {
             foreach ($combinations as $combination) {
                 $expr = new Expr();
                 $expr->field('normalizedData.completenesses.' . $combination)->exists(false);
                 $productsQb->addOr($expr);
             }
         }
     }
     $productsQb->field('family')->notEqual(null);
 }