PHP Interface Doctrine\OrientDB\Query\CommandInterface

Datei anzeigen Open project: doctrine/orientdb-odm

Public Methods

Method Description
andWhere ( string $condition, string $value = null ) : Command Sets a where token using the AND operator.
from ( array $target, boolean $append = true ) : Command Sets the FROM clause of a SQL statement, injecting an array of $target and deciding to remove previously set targets or not with the $append parameter.
getRaw ( ) : string Returns the SQL generated within this command, replacing the tokens in the schema with their actual values.
getTokenValue ( string $token ) : array Returns the value of the given $token.
getTokens ( ) : array Analizying the class SCHEMA, it returns an array containing all the tokens found there.
orWhere ( string $condition, string $value = null ) : Command Sets a where token using the OR operator.
resetWhere ( ) : true Deletes all the WHERE conditions in the current command.
where ( string $condition, mixed $value = null, boolean $append = false, string $clause = "WHERE" ) Sets a WHERE condition for the current query.

Method Details

andWhere() public method

If the $condition contains a "?", it will be replaced by the $value.
public andWhere ( string $condition, string $value = null ) : Command
$condition string
$value string
return Command

from() public method

Sets the FROM clause of a SQL statement, injecting an array of $target and deciding to remove previously set targets or not with the $append parameter.
public from ( array $target, boolean $append = true ) : Command
$target array
$append boolean
return Command

getRaw() public method

Returns the SQL generated within this command, replacing the tokens in the schema with their actual values.
public getRaw ( ) : string
return string

getTokenValue() public method

Token values are always expressed as a series of values in an array, also if the token does not support multiple values. For example, the WHERE condition supports multiple values: WHERE val1 = x AND val2 = y OR val3 = z while the LIMIT clause not: LIMIT 20 However, both those tokens values are an array: this is done to internally simplify things.
public getTokenValue ( string $token ) : array
$token string
return array

getTokens() public method

Analizying the class SCHEMA, it returns an array containing all the tokens found there.
public getTokens ( ) : array
return array

orWhere() public method

If the $condition contains a "?", it will be replaced by the $value.
public orWhere ( string $condition, string $value = null ) : Command
$condition string
$value string
return Command

resetWhere() public method

Deletes all the WHERE conditions in the current command.
public resetWhere ( ) : true
return true

where() public method

You can set the $condition using a trailing question mark, that will be replaced and safely quoted with the $value. Where conditions can be nested using the $append parameter and pre-fixed with the right $clause preposition (WHERE, AND, OR).
public where ( string $condition, mixed $value = null, boolean $append = false, string $clause = "WHERE" )
$condition string
$value mixed
$append boolean
$clause string