Exemplo n.º 1
0
 /**
  * Returns the column name quoted and with table alias prefix as needed by the implementation
  *
  * @param string $column
  * @param string $tableAlias
  * @return string
  */
 public function getColumnName($column, $tableAlias = '')
 {
     if ($tableAlias !== '') {
         $tableAlias .= '.';
     }
     return $this->helper->quoteColumnName($tableAlias . $column);
 }
Exemplo n.º 2
0
 /**
  * @param string $table
  * @return string
  */
 private function getTableName($table)
 {
     if ($this->automaticTablePrefix === false || strpos($table, '*PREFIX*') === 0) {
         return $this->helper->quoteColumnName($table);
     }
     return $this->helper->quoteColumnName('*PREFIX*' . $table);
 }
Exemplo n.º 3
0
 /**
  * @dataProvider dataQuoteColumnNames
  * @param mixed $input
  * @param string $expected
  */
 public function testQuoteColumnNames($input, $expected)
 {
     $this->assertSame($expected, $this->helper->quoteColumnNames($input));
 }
Exemplo n.º 4
0
 /**
  * Creates a NOT IN () comparison expression with the given arguments.
  *
  * @param string $x The field in string format to be inspected by NOT IN() comparison.
  * @param string|array $y The placeholder or the array of values to be used by NOT IN() comparison.
  *
  * @return string
  */
 public function notIn($x, $y)
 {
     $x = $this->helper->quoteColumnName($x);
     $y = $this->helper->quoteColumnNames($y);
     return $this->expressionBuilder->notIn($x, $y);
 }
Exemplo n.º 5
0
 /**
  * Adds an ordering to the query results.
  *
  * @param string $sort The ordering expression.
  * @param string $order The ordering direction.
  *
  * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
  */
 public function addOrderBy($sort, $order = null)
 {
     $this->queryBuilder->addOrderBy($this->helper->quoteColumnName($sort), $order);
     return $this;
 }
Exemplo n.º 6
0
 /**
  * Returns a IQueryFunction that casts the column to the given type
  *
  * @param string $column
  * @param mixed $type One of IQueryBuilder::PARAM_*
  * @return string
  */
 public function castColumn($column, $type)
 {
     return new QueryFunction($this->helper->quoteColumnName($column));
 }