PHP Class Doctrine\OrientDB\Query\Command

Inheritance: implements Doctrine\OrientDB\Query\CommandInterface
Exibir arquivo Open project: doctrine/orientdb-odm Class Usage Examples

Protected Properties

Property Type Description
$escapeValidator
$formatter
$formatters
$ridValidator
$tokens

Public Methods

Method Description
__construct ( ) Builds a new object, creating the SQL statement from the class SCHEMA and initializing the tokens.
andWhere ( string $condition, string $value = null ) : Command Sets a where token using the AND operator.
canHydrate ( ) : boolean Returns whether this query, when executed, should have the collection hydrated.
from ( array $target, boolean $append = true ) Sets the token for the from clause. You can $append your values.
getRaw ( ) : string Returns the raw SQL query incapsulated by the current object.
getTokenValue ( string $token ) : mixed Returns the value of a token.
getTokens ( ) : array Analyzing the command's SCHEMA, this method returns all the tokens allocable in the command.
getValidReturnTypes ( ) : array() Returns the array of valid params for the Return clause.
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.
returns ( $returns ) Sets the Returns token
setFormatter ( Doctrine\OrientDB\Query\Formatter\QueryInterface $formatter ) Sets the internal query formatter object.
setToken ( string $token, string $tokenValue, boolean $append = false, boolean $first = false ) : true Sets a single value for a token,
where ( string $condition, mixed $value = null, boolean $append = false, string $clause = "WHERE" ) Adds a WHERE conditions into the current query.

Protected Methods

Method Description
appendToken ( string $token, mixed $values, boolean $first = false ) Appends a token to the query, without deleting existing values for the given $token.
appendTokenAsInteger ( string $token, string $key, mixed $value ) Appends $value to the query $token.
appendTokenAsString ( string $token, string $key, mixed $value ) Appends $value to the query $token, using $key to identify the $value in the token array.
checkToken ( string $token ) : mixed Checks if a token is set, returning it if it is.
clearToken ( string $token ) Clears the value of a token.
formatWhereConditionWithMultipleTokens ( string $condition, array $values, Escaper $validator ) : string Substitutes multiple tokens ($values) in the WHERE $condition.
getFormatter ( ) : Doctrine\OrientDB\Query\Formatter\QueryInterface Returns a brand new instance of a Formatter in order to format query tokens.
getSchema ( ) Returns the schema template for the command.
getTokenFormatter ( string $token ) : Array Returns the formatter for a particular token.
getTokenFormatters ( ) : Array Returns the formatters for this query's tokens.
getTokenReplaces ( ) : array Returns the values to replace command's schema tokens.
getValidStatement ( ) : string Build the command replacing schema tokens with actual values and cleaning the command synthax.
replaceTokens ( string $statement ) : string Replaces the tokens in the command's schema with their actual values in the current object.
setTokenValues ( string $token, array $tokenValues, boolean $append = true, boolean $first = false ) : true Sets the values of a token, and can be appended with the given $append.
tokenize ( string $token ) : string Tokenizes a string.
unsetToken ( string $token ) Deletes a token.

Method Details

__construct() public method

Builds a new object, creating the SQL statement from the class SCHEMA and initializing the tokens.
public __construct ( )

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

appendToken() protected method

Appends a token to the query, without deleting existing values for the given $token.
protected appendToken ( string $token, mixed $values, boolean $first = false )
$token string
$values mixed
$first boolean

appendTokenAsInteger() protected method

Appends $value to the query $token.
protected appendTokenAsInteger ( string $token, string $key, mixed $value )
$token string
$key string
$value mixed

appendTokenAsString() protected method

With this method you set a token value and can retrieve it by its key.
protected appendTokenAsString ( string $token, string $key, mixed $value )
$token string
$key string
$value mixed

canHydrate() public method

The default is true
public canHydrate ( ) : boolean
return boolean

checkToken() protected method

Checks if a token is set, returning it if it is.
protected checkToken ( string $token ) : mixed
$token string
return mixed

clearToken() protected method

Clears the value of a token.
protected clearToken ( string $token )
$token string

formatWhereConditionWithMultipleTokens() protected method

Substitutes multiple tokens ($values) in the WHERE $condition.
protected formatWhereConditionWithMultipleTokens ( string $condition, array $values, Escaper $validator ) : string
$condition string
$values array
$validator Doctrine\OrientDB\Query\Validator\Escaper
return string

from() public method

Sets the token for the from clause. You can $append your values.
public from ( array $target, boolean $append = true )
$target array
$append boolean

getFormatter() protected method

Returns a brand new instance of a Formatter in order to format query tokens.
protected getFormatter ( ) : Doctrine\OrientDB\Query\Formatter\QueryInterface
return Doctrine\OrientDB\Query\Formatter\QueryInterface

getRaw() public method

Returns the raw SQL query incapsulated by the current object.
public getRaw ( ) : string
return string

getSchema() protected method

Returns the schema template for the command.
protected getSchema ( )

getTokenFormatter() protected method

Returns the formatter for a particular token.
protected getTokenFormatter ( string $token ) : Array
$token string
return Array

getTokenFormatters() protected method

Returns the formatters for this query's tokens.
protected getTokenFormatters ( ) : Array
return Array

getTokenReplaces() protected method

Returns the values to replace command's schema tokens.
protected getTokenReplaces ( ) : array
return array

getTokenValue() public method

Returns the value of a token.
public getTokenValue ( string $token ) : mixed
$token string
return mixed

getTokens() public method

Analyzing the command's SCHEMA, this method returns all the tokens allocable in the command.
public getTokens ( ) : array
return array

getValidReturnTypes() public method

Use this function to support the Return clause by overriding and returing a list in the subclass
public getValidReturnTypes ( ) : array()
return array()

getValidStatement() protected method

Build the command replacing schema tokens with actual values and cleaning the command synthax.
protected getValidStatement ( ) : string
return string

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

replaceTokens() protected method

Replaces the tokens in the command's schema with their actual values in the current object.
protected replaceTokens ( string $statement ) : string
$statement string
return string

resetWhere() public method

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

returns() public method

Sets the Returns token
public returns ( $returns )

setFormatter() public method

Sets the internal query formatter object.
public setFormatter ( Doctrine\OrientDB\Query\Formatter\QueryInterface $formatter )
$formatter Doctrine\OrientDB\Query\Formatter\QueryInterface

setToken() public method

Sets a single value for a token,
public setToken ( string $token, string $tokenValue, boolean $append = false, boolean $first = false ) : true
$token string
$tokenValue string
$append boolean
$first boolean
return true

setTokenValues() protected method

Sets the values of a token, and can be appended with the given $append.
protected setTokenValues ( string $token, array $tokenValues, boolean $append = true, boolean $first = false ) : true
$token string
$tokenValues array
$append boolean
$first boolean
return true

tokenize() protected method

Tokenizes a string.
protected tokenize ( string $token ) : string
$token string
return string

unsetToken() protected method

Deletes a token.
protected unsetToken ( string $token )
$token string

where() public method

Adds a WHERE conditions into the current query.
public where ( string $condition, mixed $value = null, boolean $append = false, string $clause = "WHERE" )
$condition string
$value mixed
$append boolean
$clause string

Property Details

$escapeValidator protected_oe property

protected $escapeValidator

$formatter protected_oe property

protected $formatter

$formatters protected_oe property

protected $formatters

$ridValidator protected_oe property

protected $ridValidator

$tokens protected_oe property

protected $tokens