SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
SlaxWeb\Database\Query\Where\Group Class Reference

Public Member Functions

 __construct (string $opr="AND")
 
 table (string $table)
 
 setDelim (string $delim)
 
 convert (string $table="")
 
 getParams ()
 
 where (string $column, $value, string $lOpr=Predicate::OPR_EQUAL, string $cOpr="AND")
 
 orWhere (string $column, $value, string $opr=Predicate::OPR_EQUAL)
 
 groupWhere (\Closure $predicates, string $cOpr="AND")
 
 orGroupWhere (\Closure $predicates)
 
 nestedWhere (string $column,\Closure $nested, string $lOpr=Predicate::OPR_IN, string $cOpr="AND")
 
 orNestedWhere (string $column,\Closure $nested, string $lOpr=Predicate::OPR_IN)
 

Protected Attributes

 $table = ""
 
 $list = []
 
 $opr = ""
 
 $params = []
 
 $delim = ""
 

Constructor & Destructor Documentation

SlaxWeb\Database\Query\Where\Group::__construct ( string  $opr = "AND")

Class constructor

Sets the logical operator that will be used to link this Predicate Group in the SQL DML WHERE statement.

Parameters
string$oprLogical operator name, default string("AND")

Member Function Documentation

SlaxWeb\Database\Query\Where\Group::convert ( string  $table = "")

Convert Predicate Group to Statement

Creates the SQL DML Where statement from the predicate list and returns it to the caller. Takes the name of the table to be prepended to the column names as input. If nothing is supplied, then the property 'table' is used.

Parameters
string$tableName of the table to prepend column names with, default string("")
Returns
string
SlaxWeb\Database\Query\Where\Group::getParams ( )

Get parameters

Returns the list of parameters for this predicate.

Returns
array
SlaxWeb\Database\Query\Where\Group::groupWhere ( \Closure  $predicates,
string  $cOpr = "AND" 
)

Add Where Predicate Group

Adds a group of predicates to the list. The closure received as input must receive the builder instance for building groups.

Parameters
Closure$predicatesGrouped predicates definition closure
string$cOprComparisson operator, default string("AND")
Returns
self
SlaxWeb\Database\Query\Where\Group::nestedWhere ( string  $column,
\Closure  $nested,
string  $lOpr = Predicate::OPR_IN,
string  $cOpr = "AND" 
)

Where Nested Select

Add a nested select as a value to the where predicate.

Parameters
string$columnColumn name
closure$nestedNested builder
string$lOprLogical operator, default Predicate::OPR_IN
string$cOprComparisson operator, default string("AND")
SlaxWeb\Database\Query\Where\Group::orGroupWhere ( \Closure  $predicates)

Or Where Predicate Group

Alias for 'whereGroup' method call with OR logical operator.

Parameters
closure$predicatesGrouped predicates definition closure
Returns
self
SlaxWeb\Database\Query\Where\Group::orNestedWhere ( string  $column,
\Closure  $nested,
string  $lOpr = Predicate::OPR_IN 
)

Or Where Nested Select

Alias for 'nestedWhere' method call with OR logical operator.

Parameters
string$columnColumn name
closure$nestedNested builder
string$lOprLogical operator, default Predicate::OPR_IN
Returns
self
SlaxWeb\Database\Query\Where\Group::orWhere ( string  $column,
  $value,
string  $opr = Predicate::OPR_EQUAL 
)

Or Where predicate

Alias for 'where' method call with OR logical operator.

Parameters
string$columnColumn name
mixed$valueValue of the predicate
string$oprLogical operator
Returns
self
SlaxWeb\Database\Query\Where\Group::setDelim ( string  $delim)

Set DB Object Delimiter

Sets the Database Object Delimiter character that will be used for creating the query.

Parameters
string$delimDelimiter character
Returns
self
SlaxWeb\Database\Query\Where\Group::table ( string  $table)

Set table

Sets the table name for the query. Before setting it wraps it in the delimiters.

Parameters
string$tableName of the table
Returns
self
SlaxWeb\Database\Query\Where\Group::where ( string  $column,
  $value,
string  $lOpr = Predicate::OPR_EQUAL,
string  $cOpr = "AND" 
)

Add predicament

Creates a predicate object with the input parameters, and adds it to the list of predicates. It returns an object of itself for method call linking.

Parameters
string$columnName of the column for the predicate
mixed$valueValue for the predicate
stirng$lOprLogical operator, default Predicate::OPR_EQUAL
string$cOprComparisson operator, default string("AND")
Returns
self

The documentation for this class was generated from the following file: