Documentation

Menu

## Where
in package

Where.php : 13

Represents a WHERE clause in a SQL query.

This class provides methods for building a WHERE clause in a SQL query.

### Table of Contents

#### Properties

$placeholders : array<string, mixed>
$sql : string

#### Methods

getPlaceholders() : array<string, mixed>
  Get the placeholders used in the query.
getSql() : string
  Get the SQL string for the WHERE clause.
reset() : void
  Resets the conditions in the WHERE clause of the query.
set() : void
  Constructor.

### Properties

#### $placeholders

Where.php : 23
`private array<string, mixed> $placeholders = []`

Placeholder values for PDO prepared statements

#### $sql

Where.php : 18
`private string $sql = ''`

SQL query string

### Methods

#### getPlaceholders()

Where.php : 133

Get the placeholders used in the query.

`public getPlaceholders() : array<string, mixed>`

##### Return values

array<string, mixed> —

The array of placeholders.

#### getSql()

Where.php : 123

Get the SQL string for the WHERE clause.

`public getSql() : string`

##### Return values

string —

The SQL string for the WHERE clause.

#### reset()

Where.php : 112

Resets the conditions in the WHERE clause of the query.

`public reset() : void`

This method clears any previously set conditions in the WHERE clause of the query, allowing you to start building a new set of conditions.

#### set()

Where.php : 38

Constructor.

`public set([array<int|string, mixed>|string $where = '' ]) : void`

Builds a SQL WHERE clause from an array

##### Parameters

$where : array<int|string, mixed>|string = ''

  String or Array containing the fields and values or a string Example: $where = 'id > 1234'; or: $where['id >'] = 1234; $where[] = 'first_name IS NOT NULL'; $where['some_value <>'] = 'text';

## Search results