Documentation

PdbSimpleCondition
in package
implements PdbConditionInterface

Table of Contents

Interfaces

PdbConditionInterface

Constants

BEGINS  : mixed = 'BEGINS'
BETWEEN  : mixed = 'BETWEEN'
CONTAINS  : mixed = 'CONTAINS'
ENDS  : mixed = 'ENDS'
EQUAL  : mixed = '='
GREATER_THAN  : mixed = '>'
GREATER_THAN_EQUAL  : mixed = '>='
IN  : mixed = 'IN'
IN_SET  : mixed = 'IN SET'
IS  : mixed = 'IS'
IS_NOT  : mixed = 'IS NOT'
LESS_THAN  : mixed = '<'
LESS_THAN_EQUAL  : mixed = '<='
LIKE  : mixed = 'LIKE'
NOT_EQUAL  : mixed = '!='
NOT_EQUAL_ALT  : mixed = '<>'
NOT_IN  : mixed = 'NOT IN'
OPERATORS  : mixed = [self::EQUAL, self::LESS_THAN_EQUAL, self::GREA...

Properties

$bind_type  : string|null
This controls the bind method of the 'value'.
$column  : string
$operator  : string
$value  : mixed

Methods

__construct()  : mixed
Create a condition.
__toString()  : mixed
build()  : string
Build an appropriate SQL clause for this condition.
getPreviewSql()  : string
validate()  : void
Validate this condition.
quoteLike()  : mixed

Constants

OPERATORS

public mixed OPERATORS = [self::EQUAL, self::LESS_THAN_EQUAL, self::GREATER_THAN_EQUAL, self::LESS_THAN, self::GREATER_THAN, self::NOT_EQUAL, self::NOT_EQUAL_ALT, self::IS, self::IS_NOT, self::BETWEEN, self::IN, self::NOT_IN, self::LIKE, self::CONTAINS, self::BEGINS, self::ENDS, self::IN_SET]

Properties

$bind_type

This controls the bind method of the 'value'.

public string|null $bind_type
  • Given null this uses parametric binding. This is the safest method.

  • Use the FIELD type to treat the 'value' as a column/table type. This will apply the appropriate quoting method.

  • The VALUE type will use the PDO driver's 'quote()' method. However this is still not as safe as using natural bindings.

Pdb::QUOTE_FIELD|QUOTE_VALUE|null

Methods

__construct()

Create a condition.

public __construct(string $operator, string $column, mixed $value[, string|null $bind = null ]) : mixed
Parameters
$operator : string
$column : string
$value : mixed
$bind : string|null = null

build()

Build an appropriate SQL clause for this condition.

public build(Pdb $pdb, array<string|int, mixed> &$values) : string
Parameters
$pdb : Pdb
$values : array<string|int, mixed>
Tags
inheritdoc
Return values
string

getPreviewSql()

public getPreviewSql() : string
Tags
inheritdoc
Return values
string

quoteLike()

private quoteLike(Pdb $pdb, array<string|int, mixed> &$values) : mixed
Parameters
$pdb : Pdb
$values : array<string|int, mixed>
On this page

Search results