code
stringlengths
15
9.96M
docstring
stringlengths
1
10.1k
func_name
stringlengths
1
124
language
stringclasses
1 value
repo
stringlengths
7
63
path
stringlengths
6
186
url
stringlengths
50
236
license
stringclasses
4 values
public function getLimitStart() { return $this->limitStart; }
@return int
getLimitStart
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractBaseQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractBaseQuery.php
MIT
public function setComment($comment) { // Make each line of the comment prefixed with "--", // and remove any trailing whitespace. $comment = '-- '.str_replace("\n", "\n-- ", \rtrim($comment)); // Trim off any trailing "-- ", to ensure that the comment is valid. $this->comment = \rtrim($comment, '- '); if ($this->comment) { $this->comment .= "\n"; } return $this; }
@param string $comment @return $this
setComment
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractBaseQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractBaseQuery.php
MIT
public function getComment() { return $this->comment; }
@return string
getComment
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractBaseQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractBaseQuery.php
MIT
public function partName() { return 'UNION ALL'; }
@return string
partName
php
nilportugues/php-sql-query-builder
src/Manipulation/UnionAll.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/UnionAll.php
MIT
public function __construct(Select $select, JoinQuery $joinQuery, array $columns = null) { $this->select = $select; $this->joinQuery = $joinQuery; if (!isset($columns)) { $columns = array(Column::ALL); } if (\count($columns)) { $this->setColumns($columns); } }
@param Select $select @param JoinQuery $joinQuery @param array $columns
__construct
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function limit($start, $count = 0) { return $this->select->limit($start, $count); }
@param $start @param int $count @return Select
limit
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function where($whereOperator = 'AND') { return $this->select->where($whereOperator); }
@param string $whereOperator @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
where
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function orderBy($column, $direction = OrderBy::ASC, $table = null) { return $this->select->orderBy($column, $direction, $table); }
@param string $column @param string $direction @param null $table @return Select
orderBy
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function groupBy(array $columns) { return $this->select->groupBy($columns); }
@param string[] $columns @return Select
groupBy
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function setSelectAsColumn(array $column) { $this->columnSelects[] = $column; return $this; }
Allows setting a Select query as a column value. @param array $column @return $this
setSelectAsColumn
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function getColumnSelects() { return $this->columnSelects; }
@return array
getColumnSelects
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function setValueAsColumn($value, $alias) { $this->columnValues[$alias] = $value; return $this; }
Allows setting a value to the select statement. @param string $value @param string $alias @return $this
setValueAsColumn
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function getColumnValues() { return $this->columnValues; }
@return array
getColumnValues
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function getColumnFuncs() { return $this->columnFuncs; }
@return array
getColumnFuncs
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function count($columnName = '*', $alias = '') { $table = $this->select->getTable(); $count = 'COUNT('; $count .= ($columnName !== '*') ? "$table.{$columnName}" : '*'; $count .= ')'; if (isset($alias) && \strlen($alias) > 0) { $count .= ' AS "'.$alias.'"'; } $this->columns = array($count); $this->isCount = true; return $this; }
@param string $columnName @param string $alias @return $this
count
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function isCount() { return $this->isCount; }
@return bool
isCount
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function getColumns() { if (\is_null($this->select->getTable())) { throw new QueryException('No table specified for the Select instance'); } return SyntaxFactory::createColumns($this->columns, $this->select->getTable()); }
@return \NilPortugues\Sql\QueryBuilder\Syntax\Column @throws QueryException
getColumns
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function setColumns(array $columns) { $this->columns = $columns; return $this; }
Sets the column names used to write the SELECT statement. If key is set, key is the column's alias. Value is always the column names. @param array $columns @return $this
setColumns
php
nilportugues/php-sql-query-builder
src/Manipulation/ColumnQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/ColumnQuery.php
MIT
public function partName() { return 'UNION'; }
@return string
partName
php
nilportugues/php-sql-query-builder
src/Manipulation/Union.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Union.php
MIT
public function partName() { return 'INTERSECT'; }
@return string
partName
php
nilportugues/php-sql-query-builder
src/Manipulation/Intersect.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Intersect.php
MIT
public function add(Select $select) { $this->intersect[] = $select; return $this; }
@param Select $select @return $this
add
php
nilportugues/php-sql-query-builder
src/Manipulation/Intersect.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Intersect.php
MIT
public function getIntersects() { return $this->intersect; }
@return array
getIntersects
php
nilportugues/php-sql-query-builder
src/Manipulation/Intersect.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Intersect.php
MIT
public function getTable() { throw new QueryException('INTERSECT does not support tables'); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Table
getTable
php
nilportugues/php-sql-query-builder
src/Manipulation/Intersect.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Intersect.php
MIT
public function getWhere() { throw new QueryException('INTERSECT does not support WHERE.'); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
getWhere
php
nilportugues/php-sql-query-builder
src/Manipulation/Intersect.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Intersect.php
MIT
public function where() { throw new QueryException('INTERSECT does not support the WHERE statement.'); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
where
php
nilportugues/php-sql-query-builder
src/Manipulation/Intersect.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Intersect.php
MIT
public function add(Select $select) { $this->union[] = $select; return $this; }
@param Select $select @return $this
add
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractSetQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractSetQuery.php
MIT
public function getUnions() { return $this->union; }
@return array
getUnions
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractSetQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractSetQuery.php
MIT
public function getTable() { throw new QueryException( \sprintf('%s does not support tables', $this->partName()) ); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Table
getTable
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractSetQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractSetQuery.php
MIT
public function getWhere() { throw new QueryException( \sprintf('%s does not support WHERE.', $this->partName()) ); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
getWhere
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractSetQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractSetQuery.php
MIT
public function where() { throw new QueryException( \sprintf('%s does not support the WHERE statement.', $this->partName()) ); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
where
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractSetQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractSetQuery.php
MIT
public function partName() { return 'MINUS'; }
@return string
partName
php
nilportugues/php-sql-query-builder
src/Manipulation/Minus.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Minus.php
MIT
public function __construct(Select $first, Select $second) { $this->first = $first; $this->second = $second; }
* @param Select $first @param Select $second
__construct
php
nilportugues/php-sql-query-builder
src/Manipulation/Minus.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Minus.php
MIT
public function getFirst() { return $this->first; }
@return \NilPortugues\Sql\QueryBuilder\Manipulation\Select
getFirst
php
nilportugues/php-sql-query-builder
src/Manipulation/Minus.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Minus.php
MIT
public function getSecond() { return $this->second; }
@return \NilPortugues\Sql\QueryBuilder\Manipulation\Select
getSecond
php
nilportugues/php-sql-query-builder
src/Manipulation/Minus.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Minus.php
MIT
public function getTable() { throw new QueryException('MINUS does not support tables'); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Table
getTable
php
nilportugues/php-sql-query-builder
src/Manipulation/Minus.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Minus.php
MIT
public function getWhere() { throw new QueryException('MINUS does not support WHERE.'); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
getWhere
php
nilportugues/php-sql-query-builder
src/Manipulation/Minus.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Minus.php
MIT
public function where() { throw new QueryException('MINUS does not support the WHERE statement.'); }
@throws QueryException @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
where
php
nilportugues/php-sql-query-builder
src/Manipulation/Minus.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Minus.php
MIT
public function __construct($table = null, array $values = null) { if (isset($table)) { $this->setTable($table); } if (!empty($values)) { $this->setValues($values); } }
@param string $table @param array $values
__construct
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractCreationalQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractCreationalQuery.php
MIT
public function getValues() { return $this->values; }
@return array
getValues
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractCreationalQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractCreationalQuery.php
MIT
public function setValues(array $values) { $this->values = $values; return $this; }
@param array $values @return $this
setValues
php
nilportugues/php-sql-query-builder
src/Manipulation/AbstractCreationalQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/AbstractCreationalQuery.php
MIT
public function __construct($table = null) { if (isset($table)) { $this->setTable($table); } }
@param string $table
__construct
php
nilportugues/php-sql-query-builder
src/Manipulation/Delete.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Delete.php
MIT
public function partName() { return 'DELETE'; }
@return string
partName
php
nilportugues/php-sql-query-builder
src/Manipulation/Delete.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Delete.php
MIT
public function getLimitStart() { return $this->limitStart; }
@return int
getLimitStart
php
nilportugues/php-sql-query-builder
src/Manipulation/Delete.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Delete.php
MIT
public function limit($start) { $this->limitStart = $start; return $this; }
@param int $start @return $this
limit
php
nilportugues/php-sql-query-builder
src/Manipulation/Delete.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Delete.php
MIT
public function partName() { return 'UPDATE'; }
@return string
partName
php
nilportugues/php-sql-query-builder
src/Manipulation/Update.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Update.php
MIT
public function getLimitStart() { return $this->limitStart; }
@return int
getLimitStart
php
nilportugues/php-sql-query-builder
src/Manipulation/Update.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Update.php
MIT
public function limit($start) { $this->limitStart = $start; return $this; }
@param int $start @return $this
limit
php
nilportugues/php-sql-query-builder
src/Manipulation/Update.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/Update.php
MIT
public function __construct(Select $select) { $this->select = $select; }
@param Select $select
__construct
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function setTable($table) { $this->select->setTable($table); return $this; }
@param string $table @return $this
setTable
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function leftJoin($table, $selfColumn = null, $refColumn = null, $columns = []) { return $this->join($table, $selfColumn, $refColumn, $columns, self::JOIN_LEFT); }
@param string $table @param mixed $selfColumn @param mixed $refColumn @param string[] $columns @return Select
leftJoin
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function join( $table, $selfColumn = null, $refColumn = null, $columns = [], $joinType = null ) { if (!isset($this->joins[$table])) { $select = QueryFactory::createSelect($table); $select->setColumns($columns); $select->setJoinType($joinType); $select->setParentQuery($this->select); $this->addJoin($select, $selfColumn, $refColumn); } return $this->joins[$table]; }
@param string $table @param mixed $selfColumn @param mixed $refColumn @param string[] $columns @param string $joinType @return Select
join
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function addJoin(Select $select, $selfColumn, $refColumn) { $select->isJoin(true); $table = $select->getTable()->getName(); if (!isset($this->joins[$table])) { if (!$selfColumn instanceof Column) { $newColumn = array($selfColumn); $selfColumn = SyntaxFactory::createColumn( $newColumn, $this->select->getTable() ); } $select->joinCondition()->equals($refColumn, $selfColumn); $this->joins[$table] = $select; } return $this->joins[$table]; }
@param Select $select @param mixed $selfColumn @param mixed $refColumn @return Select
addJoin
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function setJoin($isJoin = true) { $this->isJoin = $isJoin; return $this; }
Transforms Select in a joint. @param bool $isJoin @return $this
setJoin
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function rightJoin($table, $selfColumn = null, $refColumn = null, $columns = []) { return $this->join($table, $selfColumn, $refColumn, $columns, self::JOIN_RIGHT); }
@param string $table @param mixed $selfColumn @param mixed $refColumn @param string[] $columns @internal param null $selectClass @return Select
rightJoin
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function crossJoin($table, $selfColumn = null, $refColumn = null, $columns = []) { return $this->join($table, $selfColumn, $refColumn, $columns, self::JOIN_CROSS); }
@param string $table @param mixed $selfColumn @param mixed $refColumn @param string[] $columns @return Select
crossJoin
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function innerJoin($table, $selfColumn = null, $refColumn = null, $columns = []) { return $this->join($table, $selfColumn, $refColumn, $columns, self::JOIN_INNER); }
@param string $table @param mixed $selfColumn @param mixed $refColumn @param string[] $columns @return Select
innerJoin
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function on() { return $this->joinCondition(); }
Alias to joinCondition. @return Where
on
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function joinCondition() { if (!isset($this->joinCondition)) { $this->joinCondition = QueryFactory::createWhere($this->select); } return $this->joinCondition; }
WHERE constrains used for the ON clause of a (LEFT/RIGHT/INNER/CROSS) JOIN. @return Where
joinCondition
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function isJoinSelect() { return $this->isJoin; }
@return bool
isJoinSelect
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function isJoin() { return $this->isJoin; }
@return bool
isJoin
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function getJoinCondition() { return $this->joinCondition; }
@return \NilPortugues\Sql\QueryBuilder\Syntax\Where
getJoinCondition
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function setJoinCondition($joinCondition) { $this->joinCondition = $joinCondition; return $this; }
@param \NilPortugues\Sql\QueryBuilder\Syntax\Where $joinCondition @return $this
setJoinCondition
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function getJoinType() { return $this->joinType; }
@return string
getJoinType
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function setJoinType($joinType) { $this->joinType = $joinType; return $this; }
@param string $joinType @return $this
setJoinType
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function getJoins() { return $this->joins; }
@return array
getJoins
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function setJoins($joins) { $this->joins = $joins; return $this; }
@param array $joins @return $this
setJoins
php
nilportugues/php-sql-query-builder
src/Manipulation/JoinQuery.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Manipulation/JoinQuery.php
MIT
public function __construct($name, $table, $alias = '') { $this->setName($name); $this->setTable($table); $this->setAlias($alias); }
@param string $name @param string $table @param string $alias
__construct
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function partName() { return 'COLUMN'; }
@return string
partName
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function getName() { return $this->name; }
@return string
getName
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function setName($name) { $this->name = (string) $name; return $this; }
@param string $name @return $this
setName
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function getTable() { return $this->table; }
@return Table
getTable
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function setTable($table) { $newTable = array($table); $this->table = SyntaxFactory::createTable($newTable); return $this; }
@param string $table @return $this
setTable
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function getAlias() { return $this->alias; }
@return string
getAlias
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function setAlias($alias) { if (0 == \strlen($alias)) { $this->alias = null; return $this; } if ($this->isAll()) { throw new QueryException("Can't use alias because column name is ALL (*)"); } $this->alias = (string) $alias; return $this; }
@param null|string $alias @return $this @throws QueryException
setAlias
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function isAll() { return $this->getName() == self::ALL; }
Check whether column name is '*' or not. @return bool
isAll
php
nilportugues/php-sql-query-builder
src/Syntax/Column.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Column.php
MIT
public function __construct(Column $column, $direction) { $this->setColumn($column); $this->setDirection($direction); }
@param Column $column @param string $direction
__construct
php
nilportugues/php-sql-query-builder
src/Syntax/OrderBy.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/OrderBy.php
MIT
public function getColumn() { return $this->column; }
@return Column
getColumn
php
nilportugues/php-sql-query-builder
src/Syntax/OrderBy.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/OrderBy.php
MIT
public function setColumn($column) { $this->column = $column; return $this; }
@param Column $column @return $this
setColumn
php
nilportugues/php-sql-query-builder
src/Syntax/OrderBy.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/OrderBy.php
MIT
public function getDirection() { return $this->direction; }
@return string
getDirection
php
nilportugues/php-sql-query-builder
src/Syntax/OrderBy.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/OrderBy.php
MIT
public function setDirection($direction) { if (!in_array($direction, array(self::ASC, self::DESC))) { throw new \InvalidArgumentException( "Specified direction '$direction' is not allowed. Only ASC or DESC are allowed." ); } $this->direction = $direction; return $this; }
@param string $direction @throws \InvalidArgumentException @return $this
setDirection
php
nilportugues/php-sql-query-builder
src/Syntax/OrderBy.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/OrderBy.php
MIT
public function __construct($name, $schema = null) { $this->name = $name; if (!is_null($schema)) { $this->schema = $schema; } }
@param $name @param string $schema
__construct
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function __toString() { return (string) $this->name; }
@return string
__toString
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function setView($view) { $this->view = $view; return $this; }
@param bool $view @return $this
setView
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function isView() { return $this->view; }
@return bool
isView
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function getName() { return $this->name; }
@return string
getName
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function getAlias() { return $this->alias; }
@return string
getAlias
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function getCompleteName() { $alias = ($this->alias) ? " AS {$this->alias}" : ''; $schema = ($this->schema) ? "{$this->schema}." : ''; return $schema.$this->name.$alias; }
@return string
getCompleteName
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function setAlias($alias) { $this->alias = $alias; return $this; }
@param string $alias @return $this
setAlias
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function getSchema() { return $this->schema; }
@return string
getSchema
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public function setSchema($schema) { $this->schema = $schema; return $this; }
@param string @param string $schema @return $this
setSchema
php
nilportugues/php-sql-query-builder
src/Syntax/Table.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Table.php
MIT
public static function createColumns(array &$arguments, $table = null) { $createdColumns = []; foreach ($arguments as $index => $column) { if (!is_object($column)) { $newColumn = array($column); $column = self::createColumn($newColumn, $table); if (!is_numeric($index)) { $column->setAlias($index); } $createdColumns[] = $column; } else if ($column instanceof Column) { $createdColumns[] = $column; } } return \array_filter($createdColumns); }
Creates a collection of Column objects. @param array $arguments @param Table|null $table @return array
createColumns
php
nilportugues/php-sql-query-builder
src/Syntax/SyntaxFactory.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/SyntaxFactory.php
MIT
public static function createColumn(array &$argument, $table = null) { $columnName = \array_values($argument); $columnName = $columnName[0]; $columnAlias = \array_keys($argument); $columnAlias = $columnAlias[0]; if (\is_numeric($columnAlias) || \strpos($columnName, '*') !== false) { $columnAlias = null; } return new Column($columnName, (string) $table, $columnAlias); }
Creates a Column object. @param array $argument @param null|Table $table @return Column
createColumn
php
nilportugues/php-sql-query-builder
src/Syntax/SyntaxFactory.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/SyntaxFactory.php
MIT
public static function createTable($table) { $tableName = $table; if (\is_array($table)) { $tableName = \current($table); $tableAlias = \key($table); } $newTable = new Table($tableName); if (isset($tableAlias) && !is_numeric($tableAlias)) { $newTable->setAlias($tableAlias); } return $newTable; }
Creates a Table object. @param string[] $table @return Table
createTable
php
nilportugues/php-sql-query-builder
src/Syntax/SyntaxFactory.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/SyntaxFactory.php
MIT
public function __construct(QueryInterface $query) { $this->query = $query; }
@param QueryInterface $query
__construct
php
nilportugues/php-sql-query-builder
src/Syntax/Where.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Where.php
MIT
public function __clone() { return \unserialize(\serialize($this)); }
Deep copy for nested references. @return mixed
__clone
php
nilportugues/php-sql-query-builder
src/Syntax/Where.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Where.php
MIT
public function isEmpty() { $empty = \array_merge( $this->comparisons, $this->booleans, $this->betweens, $this->isNotNull, $this->isNull, $this->ins, $this->notIns, $this->subWheres, $this->exists ); return 0 == \count($empty); }
@return bool
isEmpty
php
nilportugues/php-sql-query-builder
src/Syntax/Where.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Where.php
MIT
public function getConjunction() { return $this->conjunction; }
@return string
getConjunction
php
nilportugues/php-sql-query-builder
src/Syntax/Where.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Where.php
MIT
public function conjunction($operator) { if (false === \in_array( $operator, [self::CONJUNCTION_AND, self::CONJUNCTION_OR, self::CONJUNCTION_OR_NOT, self::CONJUNCTION_AND_NOT] ) ) { throw new QueryException( "Invalid conjunction specified, must be one of AND or OR, but '".$operator."' was found." ); } $this->conjunction = $operator; return $this; }
@param string $operator @return $this @throws QueryException
conjunction
php
nilportugues/php-sql-query-builder
src/Syntax/Where.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Where.php
MIT
public function getSubWheres() { return $this->subWheres; }
@return array
getSubWheres
php
nilportugues/php-sql-query-builder
src/Syntax/Where.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Where.php
MIT
public function subWhere($operator = 'OR') { /** @var Where $filter */ $filter = QueryFactory::createWhere($this->query); $filter->conjunction($operator); $filter->setTable($this->getTable()); $this->subWheres[] = $filter; return $filter; }
@param $operator @return Where
subWhere
php
nilportugues/php-sql-query-builder
src/Syntax/Where.php
https://github.com/nilportugues/php-sql-query-builder/blob/master/src/Syntax/Where.php
MIT