Documentation

PdbCondition
in package
implements PdbConditionInterface

AbstractYes

This is a helper for building conditions from the array syntax.

Although you can extend this to implement new conditions, best not. Use PdbConditionInterface instead.

Table of Contents

Interfaces

PdbConditionInterface

Methods

buildClause()  : string
Build a set of conditions into SQL.
fromArray()  : array<string|int, PdbConditionInterface>
Create a list of conditions objects from a list of configuration shorthand arrays.
fromShorthand()  : PdbConditionInterface
Create a condition object from a shorthand array.

Methods

buildClause()

Build a set of conditions into SQL.

public static buildClause(Pdb $pdb, array<string|int, mixed>|PdbConditionInterface $conditions, array<string|int, mixed> &$values[, string $combine = 'AND' ][, bool $validate = true ]) : string
Parameters
$pdb : Pdb
$conditions : array<string|int, mixed>|PdbConditionInterface
$values : array<string|int, mixed>
$combine : string = 'AND'
$validate : bool = true
Tags
see
Pdb::buildClause()
throws
InvalidArgumentException
InvalidConditionException
PDOException
Return values
string

fromShorthand()

Create a condition object from a shorthand array.

public static fromShorthand(string|int|null $key, PdbConditionInterface|array<string|int, mixed>|string|int|float|null $item) : PdbConditionInterface

A 'shorthand' array is one 3 forms:

  1. [column, operator, value]
  2. [operator, column => value]
  3. [column => value]

The third is only for equality, IN, IS NULL conditions.

Parameters
$key : string|int|null
$item : PdbConditionInterface|array<string|int, mixed>|string|int|float|null
Tags
throws
InvalidConditionException
Return values
PdbConditionInterface
On this page

Search results