/** * @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; }
/** * @return InExpression **/ public function toMapped(ProtoDAO $dao, JoinCapableQuery $query) { if (is_array($this->right)) { $right = array(); 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); }
/** * @return PrefixUnaryExpression **/ public function toMapped(ProtoDAO $dao, JoinCapableQuery $query) { return new self($this->logic, $dao->guessAtom($this->subject, $query)); }
/** * @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)); }
/** * @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)); }
/** * @return ExtractPart **/ public function toMapped(ProtoDAO $dao, JoinCapableQuery $query) { return self::create($this->what, $dao->guessAtom($this->from, $query)); }
/** * @return PostfixUnaryExpression **/ public function toMapped(ProtoDAO $dao, JoinCapableQuery $query) { $expression = new self($dao->guessAtom($this->subject, $query), $this->logic); return $expression->noBrackets(!$this->brackets); }
/** * @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; }