writer = $writer; $this->placeholderWriter = $placeholder; $this->columnWriter = WriterFactory::createColumnWriter($writer, $placeholder); } /** * @param AbstractBaseQuery $class * * @return string */ public static function writeQueryComment(AbstractBaseQuery $class) { $comment = ''; if ('' !== $class->getComment()) { $comment = $class->getComment(); } return $comment; } /** * @param AbstractBaseQuery $class * @param \Phacil\Framework\MagiQL\Api\BuilderInterface $writer * @param PlaceholderWriter $placeholderWriter * @param array $parts */ public static function writeWhereCondition( AbstractBaseQuery $class, \Phacil\Framework\MagiQL\Api\BuilderInterface $writer, PlaceholderWriter $placeholderWriter, array &$parts ) { if (!is_null($class->getWhere())) { $whereWriter = WriterFactory::createWhereWriter($writer, $placeholderWriter); $parts[] = "WHERE {$whereWriter->writeWhere($class->getWhere())}"; } } /** * @param AbstractBaseQuery $class * @param PlaceholderWriter $placeholderWriter * @param array $parts */ public static function writeLimitCondition( AbstractBaseQuery $class, PlaceholderWriter $placeholderWriter, array &$parts ) { if (!is_null($class->getLimitStart())) { $start = $placeholderWriter->add($class->getLimitStart()); $parts[] = "LIMIT {$start}"; } } }