namespace \webfiori\database
abstract class AbstractQuery
Class Methods Summary
Class Methods Details
Parameters:
Parameters:
- string $keyName The name of the foreign key as specified when creating the table.
Parameters:
Parameters:
- AbstractQuery|string $col A string that represents the name of the column that will be evaluated. This also can be an object of type 'AbstractQuery' in case the developer would like to build a sub-where condition.
- string $cond A string that represents the condition at which column value will be evaluated against. Can be ignored if first parameter is of type 'AbstractQuery'.
- mixed $val The value (or values) at which the column will be evaluated against. Can be ignored if first parameter is of type 'AbstractQuery'.
Creates and returns a copy of the builder. The information that will be copied includes:
- Limit.
- Offset.
- Linked table.
- Linked schema.
Parameters:
- string $colKey The name of column key taken from the table.
Parameters:
- string $keyName The name of the key.
Parameters:
- string $pkName The name of the primary key.
Parameters:
Parameters:
- array $colsAndVals An associative array that holds the columns and values. The indices of the array should be column keys and the values of the indices are the new values.
Parameters:
- AbstractQuery $query The query at which the current query result will be joined with.
- string $joinType The type of the join such as 'left join'.
Parameters:
- AbstractQuery $query The query at which the current query result will be joined with.
Parameters:
- int $limit A number which is greater than 0.
Parameters:
Parameters:
- int $offset Number of records to skip.
Parameters:
Parameters:
- AbstractQuery|string $col A string that represents the name of the column that will be evaluated. This also can be an object of type 'AbstractQuery' in case the developer would like to build a sub-where condition.
- string $cond A string that represents the condition at which column value will be evaluated against. Can be ignored if first parameter is of type 'AbstractQuery'.
- mixed $val The value (or values) at which the column will be evaluated against. Can be ignored if first parameter is of type 'AbstractQuery'.
Parameters:
- array $colsArr An array that contains columns keys. To specify order type, the indices should be columns keys and the values are order type. Order type can have two values, 'a' for ascending or 'd' for descending.
Parameters:
Parameters:
Parameters:
- AbstractQuery $query The query at which the current query result will be joined with.
Parameters:
- array $cols An array that contains the keys of the columns that will be selected. This also can be an array that holds objects of type 'Expression'. Also, it can be an associative array of columns keys and sub arrays. The sub arrays can have options for the columns that will be selected. Supported options are:
- 'obj': An object of type column or an expression.
- 'alias': An optional string which can act as an alias.
- 'aggregate': Aggregate function to use in the column such as 'avg' or 'max'.
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
- array $parameters An array that holds the parameters. The structure of the array depends on how the developer have implemented the method Connection::bind().
Parameters:
- boolean $bool True to make a prepared query before execution. False to execute the query without preparation.
Parameters:
Parameters:
- Database $schema The schema at which the generator will be associated with.
Parameters:
- Table $table The table that will be associated.
Parameters:
- string $tblName The name of the table.
Parameters:
- AbstractQuery $query
- boolean $all
Parameters:
- array $newColsVals An associative array that holds the columns and values. The indices of the array should be column keys and the values of the indices are the new values.
Parameters:
- AbstractQuery|string $col The key of the column. This also can be an object of type AbstractQuery. The object is used to build a sub where condition.
- string $cond A string such as '=' or '!='.
- mixed $val The value at which column value will be evaluated againest.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.
Parameters:
- string $col The key of the column that the condition will be based on.
- mixed $firstVal The left hand side operand of the between condition.
- mixed $secondVal The right hand side operand of the between condition.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.
- boolean $not If set to true, the 'between' condition will be set to 'not between'.
Parameters:
- string $col The key of the column that the condition will be based on.
- array $vals An array that holds the values that will be checked.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.
- boolean $not If set to true, the 'in' condition will be set to 'not in'.
Parameters:
- string $col The key of the column that the condition will be based on. Note that the column type must be a string type such as varchar or the call to the method will be ignored.
- int $charsCount The number of characters that will be taken from the left of the column value.
- string $cond A condition at which the comparison will be based on. can only have 4 values, '=', '!=', 'in' and 'not in'.
- string|array $val The value at which the condition will be compared with. This also can be an array of values if the condition is 'in' or 'not in'.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.
Parameters:
- string $col The key of the column that the condition will be based on. Note that the column type must be a string type such as varchar or the call to the method will be ignored.
- string $val The value at which the 'like' condition will be based on.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.
- boolean $not If set to true, the 'like' condition will be set to 'not like'.
Parameters:
- string $col The key of the column that the condition will be based on.
- mixed $firstVal The left hand side operand of the between condition.
- mixed $secVal The right hand side operand of the between condition.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.
Parameters:
Parameters:
- string $col The key of the column that the condition will be based on. Note that the column type must be a string type such as varchar or the call to the method will be ignored.
- string $val The value at which the 'like' condition will be based on.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.
Parameters:
Parameters:
Parameters:
- string $col The key of the column that the condition will be based on. Note that the column type must be a string type such as varchar or the call to the method will be ignored.
- int $charsCount The number of characters that will be taken from the right of the column value.
- string $cond A condition at which the comparison will be based on. can only have 4 values, '=', '!=', 'in' and 'not in'.
- string|array $val The value at which the condition will be compared with. This also can be an array of values if the condition is 'in' or 'not in'.
- string $joinCond An optional string which could be used to join more than one condition ('and' or 'or'). If not given, 'and' is used as default value.