示例#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
文件: Fuel.php 项目: atabak/orm
 /**
  * {@inheritdoc}
  */
 public function update($table, $values)
 {
     $this->currentQuery = $this->connection->update($table);
     foreach ($values as $name => $value) {
         // TODO: Add proper PK checks in here
         if ($name !== 'id') {
             $this->currentQuery->set($name, $value);
         }
     }
     // TODO: Update to use the actual PK
     $this->where('id', '=', $values['id']);
 }
示例#4
0
 /**
  * Return the expression.
  *
  * @return  mixed  expression
  */
 public function getValue(Connection $connection)
 {
     $compiler = $connection->getCompiler();
     return $compiler->compileCase($this);
 }
示例#5
0
 /**
  * Return the quoted identifier.
  *
  * @return  mixed  expression
  */
 public function getValue(Connection $connection)
 {
     return $connection->quote($this->value);
 }
示例#6
0
 /**
  * Return the expression.
  *
  * @return  mixed  expression
  */
 public function getValue(Connection $connection)
 {
     $compiler = $connection->getCompiler();
     return $compiler->compileIncrement($this->value, $this->amount);
 }