Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 908 Bytes

Grouping.md

File metadata and controls

31 lines (23 loc) · 908 Bytes

Used in Select, Udpdate and Delete statements.

Used by Join clauses.

Constructor

__construct($rule, $clauses)

Parameter Description
$rule Rule to use when combining conditionals
$clauses Array of conditionals to combine

Example

use FaaPz\PDO\Clause\Conditional;
use FaaPz\PDO\Clause\Grouping;

// ... WHERE col1 = ? AND (col2 = ? OR col3 = ?)
$statement->where(
    new Grouping('AND', [
        new Conditional('col1', '=', 'val1'),
        new Grouping('OR', [
            new Conditional('col2', '=', 'val2'),
            new Conditional('col3', '=', 'val3')
        ])
    ]);