Example #1
0
 /**
  * @return SQLChain
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     $size = count($this->chain);
     Assert::isTrue($size > 0, 'empty chain');
     $chain = new $this();
     for ($i = 0; $i < $size; ++$i) {
         $chain->exp($dao->guessAtom($this->chain[$i], $query), $this->logic[$i]);
     }
     return $chain;
 }
Example #2
0
 /**
  * @return InExpression
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     if (is_array($this->right)) {
         $right = [];
         foreach ($this->right as $atom) {
             $right[] = $dao->guessAtom($atom, $query);
         }
     } elseif ($this->right instanceof MappableObject) {
         $right = $this->right->toMapped($dao, $query);
     } else {
         $right = $this->right;
     }
     // untransformable
     return new self($dao->guessAtom($this->left, $query), $right, $this->logic);
 }
Example #3
0
 /**
  * @return ExtractPart
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     return self::create($this->what, $dao->guessAtom($this->from, $query));
 }
Example #4
0
 /**
  * @return BinaryExpression
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     $expression = new self($dao->guessAtom($this->left, $query), $dao->guessAtom($this->right, $query), $this->logic);
     return $expression->noBrackets(!$this->brackets);
 }
Example #5
0
 /**
  * @return LogicalBetween
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     return new self($dao->guessAtom($this->field, $query), $dao->guessAtom($this->left, $query), $dao->guessAtom($this->right, $query));
 }
Example #6
0
 /**
  * @return OrderBy
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     $order = self::create($dao->guessAtom($this->field, $query));
     if (!$this->nulls->isNull()) {
         $order->setNullsFirst($this->nulls->getValue());
     }
     if (!$this->direction->isNull()) {
         $order->setDirection($this->direction->getValue());
     }
     return $order;
 }
Example #7
0
 /**
  * @return FullText
  **/
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     return new $this($dao->guessAtom($this->field, $query, $dao->getTable()), $this->words, $this->logic);
 }
 public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
 {
     return new self($dao->guessAtom($this->range, $query), $dao->guessAtom($this->ip, $query));
 }