tflori/orm

just another orm...

View the Project on GitHub tflori/orm

Build Status Test Coverage Maintainability Latest Stable Version Total Downloads

» API Reference » ORM\QueryBuilder\ParenthesisInterface

ORM\QueryBuilder\ParenthesisInterface

Table of Contents

Abstract

Interface ParenthesisInterface

Methods

ORM\QueryBuilder\ParenthesisInterface::andParenthesis

public function andParenthesis(): $this
Add a parenthesis with AND
Returns $this  

ORM\QueryBuilder\ParenthesisInterface::andParenthesis

↑ top


ORM\QueryBuilder\ParenthesisInterface::andWhere

public function andWhere(
    string $column, 
    string|array $operator = '', 
    string $value = '', 
): $this
Add a where condition with AND.

QueryBuilderInterface andWhere($column[, $operator[, $value]]);

If $column has the same amount of question marks as $value - $value is the second parameter.

If there is no third parameter and no question mark in $column then the default operator is ‘=’ and $value is the second parameter.

These calls are equal:

$query->andWhere('name', '=' , 'John Doe');
$query->andWhere('name = ?', 'John Doe');
$query->andWhere('name', 'John Doe');
$query->andWhere('name = ?', ['John Doe']);
Returns $this  
Parameters
Parameter Type Description  
$column string Column or expression with placeholders  
$operator **string array** Operator, value or array of values
$value string Value (required when used with operator)  

ORM\QueryBuilder\ParenthesisInterface::andWhere

↑ top


ORM\QueryBuilder\ParenthesisInterface::close

public function close(
    , 
): \ORM\QueryBuilder\QueryBuilderInterface|\ORM\QueryBuilder\ParenthesisInterface
Close parenthesis
Returns ORM\QueryBuilder\QueryBuilderInterface|ORM\QueryBuilder\ParenthesisInterface  

ORM\QueryBuilder\ParenthesisInterface::close

↑ top


ORM\QueryBuilder\ParenthesisInterface::getExpression

public function getExpression(): string
Get the expression

Returns the complete expression inside this parenthesis.

Returns string  

ORM\QueryBuilder\ParenthesisInterface::getExpression

↑ top


ORM\QueryBuilder\ParenthesisInterface::orParenthesis

public function orParenthesis(): $this
Add a parenthesis with OR
Returns $this  

ORM\QueryBuilder\ParenthesisInterface::orParenthesis

↑ top


ORM\QueryBuilder\ParenthesisInterface::orWhere

public function orWhere(
    string $column, 
    string|array $operator = '', 
    string $value = '', 
): $this
Add a where condition with OR.

QueryBuilderInterface orWhere($column[, $operator[, $value]]);

If $column has the same amount of question marks as $value - $value is the second parameter.

If there is no third parameter and no question mark in $column then the default operator is ‘=’ and $value is the second parameter.

These calls are equal:

$query->orWhere('name', '=' , 'John Doe');
$query->orWhere('name = ?', 'John Doe');
$query->orWhere('name', 'John Doe');
$query->orWhere('name = ?', ['John Doe']);
Returns $this  
Parameters
Parameter Type Description  
$column string Column or expression with placeholders  
$operator **string array** Operator, value or array of values
$value string Value (required when used with operator)  

ORM\QueryBuilder\ParenthesisInterface::orWhere

↑ top


ORM\QueryBuilder\ParenthesisInterface::orWhereIn

public function orWhereIn(string|array $column, array $values): $this
Add a where in condition with OR.

If $column is an array a composite where in statement will be created

Example: whereIn(['a', 'b'], [[42, 23], [42, 23]]) gets (a,b) IN ((42,23), (23,42)) in mysql

If $values is empty the expression will be 1 = 0 because an empty parenthesis causes an error in SQL.

Returns $this  
Parameters
Parameter Type Description  
$column **string array**  
$values array    

ORM\QueryBuilder\ParenthesisInterface::orWhereIn

↑ top


ORM\QueryBuilder\ParenthesisInterface::orWhereNotIn

public function orWhereNotIn(string|array $column, array $values): $this
Add a where not in condition with OR.

If $column is an array a composite where in statement will be created

Example: whereIn(['a', 'b'], [[42, 23], [42, 23]]) gets (a,b) NOT IN ((42,23), (23,42)) in mysql

If $values is empty the expression will be 1 = 1 because an empty parenthesis causes an error in SQL.

Returns $this  
Parameters
Parameter Type Description  
$column **string array**  
$values array    

ORM\QueryBuilder\ParenthesisInterface::orWhereNotIn

↑ top


ORM\QueryBuilder\ParenthesisInterface::parenthesis

public function parenthesis(): $this
Alias for andParenthesis
Returns $this  

See Also:

ORM\QueryBuilder\ParenthesisInterface::parenthesis

↑ top


ORM\QueryBuilder\ParenthesisInterface::where

public function where(
    string $column, 
    mixed $operator = '', 
    mixed $value = '', 
): $this
Alias for andWhere

QueryBuilderInterface where($column[, $operator[, $value]]);

If $column has the same amount of question marks as $value - $value is the second parameter.

If there is no third parameter and no question mark in $column then the default operator is ‘=’ and $value is the second parameter.

These calls are equal:

$query->where('name', '=' , 'John Doe');
$query->where('name = ?', 'John Doe');
$query->where('name', 'John Doe');
$query->where('name = ?', ['John Doe']);
Returns $this  
Parameters
Parameter Type Description
$column string Column or expression with placeholders
$operator mixed Operator, value or array of values
$value mixed Value (required when used with operator)

See Also:

ORM\QueryBuilder\ParenthesisInterface::where

↑ top


ORM\QueryBuilder\ParenthesisInterface::whereIn

public function whereIn(string|array $column, array $values): $this
Add a where in condition with AND.

If $column is an array a composite where in statement will be created

Example: whereIn(['a', 'b'], [[42, 23], [42, 23]]) gets (a,b) IN ((42,23), (23,42)) in mysql

If $values is empty the expression will be 1 = 0 because an empty parenthesis causes an error in SQL.

Returns $this  
Parameters
Parameter Type Description  
$column **string array**  
$values array    

ORM\QueryBuilder\ParenthesisInterface::whereIn

↑ top


ORM\QueryBuilder\ParenthesisInterface::whereNotIn

public function whereNotIn(string|array $column, array $values): $this
Add a where not in condition with AND.

If $column is an array a composite where in statement will be created

Example: whereIn(['a', 'b'], [[42, 23], [42, 23]]) gets (a,b) NOT IN ((42,23), (23,42)) in mysql

If $values is empty the expression will be 1 = 1 because an empty parenthesis causes an error in SQL.

Returns $this  
Parameters
Parameter Type Description  
$column **string array**  
$values array    

ORM\QueryBuilder\ParenthesisInterface::whereNotIn

↑ top