示例#1
0
 /**
  * Format the concat statement
  *
  * @param    Fuel\Database\Connection  $connection
  * @return   string  concat statement
  */
 public function compileConcat($connection)
 {
     $compiler = $connection->getCompiler();
     if (method_exists($compiler, $method = 'compileCommand' . ucfirst($this->command))) {
         return call_user_func(array($compiler, $method), $this->arguments);
     }
     $command = strtoupper($this->command);
     $arguments = empty($this->arguments) ? '' : $connection->quote($this->arguments);
     return $command . '(' . $arguments . ')';
 }
示例#2
0
 /**
  * Return the quoted identifier.
  *
  * @return  mixed  expression
  */
 public function getValue(Connection $connection)
 {
     $compiler = $connection->getCompiler();
     $identifiers = $compiler->compileIdentifiers((array) $this->value);
     $sql = 'MATCH (' . $identifiers . ') AGAINST (';
     $sql .= $connection->quote($this->against);
     if ($this->boolean) {
         $sql .= ' IN BOOLEAN MODE';
     } elseif ($this->expand) {
         $sql .= ' WITH QUERY EXPANSION';
     }
     return $sql . ')';
 }
示例#3
0
 /**
  * Return the quoted identifier.
  *
  * @return  mixed  expression
  */
 public function getValue(Connection $connection)
 {
     return $connection->quote($this->value);
 }