PHP Class Doctrine\OrientDB\Query\Command

Inheritance: implements Doctrine\OrientDB\Query\CommandInterface
Afficher le fichier Open project: doctrine/orientdb-odm Class Usage Examples

Protected Properties

Свойство Type Description
$escapeValidator
$formatter
$formatters
$ridValidator
$tokens

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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

andWhere() public méthode

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

appendToken() protected méthode

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 méthode

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

appendTokenAsString() protected méthode

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 méthode

The default is true
public canHydrate ( ) : boolean
Résultat boolean

checkToken() protected méthode

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

clearToken() protected méthode

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

formatWhereConditionWithMultipleTokens() protected méthode

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
Résultat string

from() public méthode

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 méthode

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

getRaw() public méthode

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

getSchema() protected méthode

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

getTokenFormatter() protected méthode

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

getTokenFormatters() protected méthode

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

getTokenReplaces() protected méthode

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

getTokenValue() public méthode

Returns the value of a token.
public getTokenValue ( string $token ) : mixed
$token string
Résultat mixed

getTokens() public méthode

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

getValidReturnTypes() public méthode

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

getValidStatement() protected méthode

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

orWhere() public méthode

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

replaceTokens() protected méthode

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

resetWhere() public méthode

Deletes all the WHERE conditions in the current command.
public resetWhere ( ) : true
Résultat true

returns() public méthode

Sets the Returns token
public returns ( $returns )

setFormatter() public méthode

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

setToken() public méthode

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
Résultat true

setTokenValues() protected méthode

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
Résultat true

tokenize() protected méthode

Tokenizes a string.
protected tokenize ( string $token ) : string
$token string
Résultat string

unsetToken() protected méthode

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

where() public méthode

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