PHP 클래스 Pinq\Expressions\Expression

저자: Elliot Levin ([email protected])
상속: implements Serializable
파일 보기 프로젝트 열기: timetoogo/pinq 1 사용 예제들

공개 메소드들

메소드 설명
__clone ( )
__toString ( )
allOfType ( array $expressions, string $type, boolean $allowNull = false ) : boolean Returns whether the expressions are all of the supplied type.
argument ( Expression $value, boolean $isUnpacked = false ) : ArgumentExpression
arrayExpression ( array $items ) : ArrayExpression
arrayItem ( Expression $key = null, Expression $value, boolean $isReference = false ) : ArrayItemExpression
asEvaluator ( Pinq\Expressions\IEvaluationContext $context = null ) : Pinq\Expressions\IEvaluator Creates an expression evaluator for the expression with the supplied context.
assign ( Expression $assignToValue, string $assignmentOperator, Expression $assignmentValue ) : AssignmentExpression
binaryOperation ( Expression $leftOperand, string $operator, Expression $rightOperand ) : BinaryOperationExpression
cast ( string $castType, Expression $castValue ) : CastExpression
classConstant ( Expression $class, string $name ) : ClassConstantExpression
cloneAll ( array $expressions ) : Expression | null[]
closure ( boolean $returnsReference, boolean $isStatic, array $parameterExpressions, array $usedVariables, array $bodyExpressions ) : ClosureExpression
closureUsedVariable ( string $name, boolean $isReference = false ) : ClosureUsedVariableExpression
compile ( ) : string Compiles the expression tree into equivalent PHP code.
compileAll ( array $expressions ) : string[] Compiles into equivalent PHP code
compileDebug ( ) : string Compiles the expression tree into debug code.
constant ( string $name ) : ConstantExpression
emptyExpression ( Expression $value ) : EmptyExpression
equals ( Expression $expression ) : boolean Returns whether the expression is equivalent to the supplied expression.
evaluate ( Pinq\Expressions\IEvaluationContext $context = null ) : mixed Evaluates the expression tree in the supplied context and returns the resulting value.
field ( Expression $value, Expression $name ) : FieldExpression
functionCall ( Expression $name, array $arguments = [] ) : FunctionCallExpression
getExpressionTypeName ( ) : string Gets a string representing the name of the expression.
getType ( ) : string Gets the class name as a string.
hash ( ) : string Returns a value hash for the expression.
hashAll ( array $expressions ) : string Returns a value hash for the supplied expressions.
index ( Expression $value, Expression $index = null ) : IndexExpression
invocation ( Expression $valueExpression, array $arguments = [] ) : InvocationExpression
issetExpression ( array $values ) : IssetExpression
methodCall ( Expression $value, Expression $name, array $arguments = [] ) : MethodCallExpression
newExpression ( Expression $classType, array $arguments = [] ) : NewExpression
parameter ( string $name, string | null $typeHint = null, Expression $defaultValue = null, boolean $isPassedByReference = false, boolean $isVariadic = false ) : ParameterExpression
returnExpression ( Expression $value = null ) : ReturnExpression
simplify ( Pinq\Expressions\IEvaluationContext $context = null ) : Expression Simplifies the expression tree in the supplied context.
simplifyAll ( array $expressions, Pinq\Expressions\IEvaluationContext $context = null ) : Expression[]
staticField ( Expression $class, Expression $name ) : StaticFieldExpression
staticMethodCall ( Expression $class, Expression $name, array $arguments = [] ) : StaticMethodCallExpression
ternary ( Expression $condition, Expression $ifTrue = null, Expression $ifFalse ) : TernaryExpression
throwExpression ( Expression $exception ) : ThrowExpression
traverse ( ExpressionWalker $walker ) : Expression
unaryOperation ( string $unaryOperator, Expression $operand ) : UnaryOperationExpression
unsetExpression ( array $values ) : UnsetExpression
value ( mixed $value ) : ValueExpression
variable ( Expression $name ) : VariableExpression

보호된 메소드들

메소드 설명
cannotEvaluate ( )
compileCode ( &$code )
isNormalSyntaxName ( string $name ) : boolean Returns whether the supplied name is considered normal name syntax and can be used plainly in code.
verifyAll ( array $expressions, string $type = __CLASS__ ) : Expression[] Verifies the supplied array only contains expressions of the supplied type.

메소드 상세

__clone() 추상적인 공개 메소드

abstract public __clone ( )

__toString() 최종 공개 메소드

final public __toString ( )

allOfType() 최종 공개 정적인 메소드

Returns whether the expressions are all of the supplied type.
final public static allOfType ( array $expressions, string $type, boolean $allowNull = false ) : boolean
$expressions array
$type string
$allowNull boolean
리턴 boolean

argument() 최종 공개 정적인 메소드

final public static argument ( Expression $value, boolean $isUnpacked = false ) : ArgumentExpression
$value Expression
$isUnpacked boolean
리턴 ArgumentExpression

arrayExpression() 최종 공개 정적인 메소드

final public static arrayExpression ( array $items ) : ArrayExpression
$items array
리턴 ArrayExpression

arrayItem() 최종 공개 정적인 메소드

final public static arrayItem ( Expression $key = null, Expression $value, boolean $isReference = false ) : ArrayItemExpression
$key Expression
$value Expression
$isReference boolean
리턴 ArrayItemExpression

asEvaluator() 공개 메소드

Creates an expression evaluator for the expression with the supplied context.
public asEvaluator ( Pinq\Expressions\IEvaluationContext $context = null ) : Pinq\Expressions\IEvaluator
$context Pinq\Expressions\IEvaluationContext
리턴 Pinq\Expressions\IEvaluator

assign() 최종 공개 정적인 메소드

final public static assign ( Expression $assignToValue, string $assignmentOperator, Expression $assignmentValue ) : AssignmentExpression
$assignToValue Expression
$assignmentOperator string
$assignmentValue Expression
리턴 AssignmentExpression

binaryOperation() 최종 공개 정적인 메소드

final public static binaryOperation ( Expression $leftOperand, string $operator, Expression $rightOperand ) : BinaryOperationExpression
$leftOperand Expression
$operator string
$rightOperand Expression
리턴 BinaryOperationExpression

cannotEvaluate() 최종 보호된 정적인 메소드

final protected static cannotEvaluate ( )

cast() 최종 공개 정적인 메소드

final public static cast ( string $castType, Expression $castValue ) : CastExpression
$castType string
$castValue Expression
리턴 CastExpression

classConstant() 최종 공개 정적인 메소드

final public static classConstant ( Expression $class, string $name ) : ClassConstantExpression
$class Expression
$name string
리턴 ClassConstantExpression

cloneAll() 최종 공개 정적인 메소드

final public static cloneAll ( array $expressions ) : Expression | null[]
$expressions array
리턴 Expression | null[]

closure() 최종 공개 정적인 메소드

final public static closure ( boolean $returnsReference, boolean $isStatic, array $parameterExpressions, array $usedVariables, array $bodyExpressions ) : ClosureExpression
$returnsReference boolean
$isStatic boolean
$parameterExpressions array
$usedVariables array
$bodyExpressions array
리턴 ClosureExpression

closureUsedVariable() 최종 공개 정적인 메소드

final public static closureUsedVariable ( string $name, boolean $isReference = false ) : ClosureUsedVariableExpression
$name string
$isReference boolean
리턴 ClosureUsedVariableExpression

compile() 최종 공개 메소드

Compiles the expression tree into equivalent PHP code.
final public compile ( ) : string
리턴 string

compileAll() 최종 공개 정적인 메소드

Compiles into equivalent PHP code
final public static compileAll ( array $expressions ) : string[]
$expressions array
리턴 string[]

compileCode() 추상적인 보호된 메소드

abstract protected compileCode ( &$code )

compileDebug() 최종 공개 메소드

Compiles the expression tree into debug code.
final public compileDebug ( ) : string
리턴 string

constant() 최종 공개 정적인 메소드

final public static constant ( string $name ) : ConstantExpression
$name string
리턴 ConstantExpression

emptyExpression() 최종 공개 정적인 메소드

final public static emptyExpression ( Expression $value ) : EmptyExpression
$value Expression
리턴 EmptyExpression

equals() 공개 메소드

Returns whether the expression is equivalent to the supplied expression.
public equals ( Expression $expression ) : boolean
$expression Expression
리턴 boolean

evaluate() 공개 메소드

Evaluates the expression tree in the supplied context and returns the resulting value.
public evaluate ( Pinq\Expressions\IEvaluationContext $context = null ) : mixed
$context Pinq\Expressions\IEvaluationContext
리턴 mixed

field() 최종 공개 정적인 메소드

final public static field ( Expression $value, Expression $name ) : FieldExpression
$value Expression
$name Expression
리턴 FieldExpression

functionCall() 최종 공개 정적인 메소드

final public static functionCall ( Expression $name, array $arguments = [] ) : FunctionCallExpression
$name Expression
$arguments array
리턴 FunctionCallExpression

getExpressionTypeName() 최종 공개 정적인 메소드

For instance \Pinq\Expressions\BinaryOperationExpression::getExpressionTypeName() returns 'BinaryOperation'
final public static getExpressionTypeName ( ) : string
리턴 string

getType() 최종 공개 정적인 메소드

Gets the class name as a string.
final public static getType ( ) : string
리턴 string

hash() 최종 공개 메소드

Returns a value hash for the expression.
final public hash ( ) : string
리턴 string

hashAll() 최종 공개 정적인 메소드

Returns a value hash for the supplied expressions.
final public static hashAll ( array $expressions ) : string
$expressions array
리턴 string

index() 최종 공개 정적인 메소드

final public static index ( Expression $value, Expression $index = null ) : IndexExpression
$value Expression
$index Expression
리턴 IndexExpression

invocation() 최종 공개 정적인 메소드

final public static invocation ( Expression $valueExpression, array $arguments = [] ) : InvocationExpression
$valueExpression Expression
$arguments array
리턴 InvocationExpression

isNormalSyntaxName() 최종 보호된 정적인 메소드

Example: 'foo' -> yes: $foo 'foo bar' -> no: ${'foo bar'}
final protected static isNormalSyntaxName ( string $name ) : boolean
$name string The field, function, method or variable name
리턴 boolean

issetExpression() 최종 공개 정적인 메소드

final public static issetExpression ( array $values ) : IssetExpression
$values array
리턴 IssetExpression

methodCall() 최종 공개 정적인 메소드

final public static methodCall ( Expression $value, Expression $name, array $arguments = [] ) : MethodCallExpression
$value Expression
$name Expression
$arguments array
리턴 MethodCallExpression

newExpression() 최종 공개 정적인 메소드

final public static newExpression ( Expression $classType, array $arguments = [] ) : NewExpression
$classType Expression
$arguments array
리턴 NewExpression

parameter() 최종 공개 정적인 메소드

final public static parameter ( string $name, string | null $typeHint = null, Expression $defaultValue = null, boolean $isPassedByReference = false, boolean $isVariadic = false ) : ParameterExpression
$name string
$typeHint string | null
$defaultValue Expression
$isPassedByReference boolean
$isVariadic boolean
리턴 ParameterExpression

returnExpression() 최종 공개 정적인 메소드

final public static returnExpression ( Expression $value = null ) : ReturnExpression
$value Expression
리턴 ReturnExpression

simplify() 공개 메소드

Example: -2 + 4 Will become: 2
public simplify ( Pinq\Expressions\IEvaluationContext $context = null ) : Expression
$context Pinq\Expressions\IEvaluationContext
리턴 Expression

simplifyAll() 최종 공개 정적인 메소드

final public static simplifyAll ( array $expressions, Pinq\Expressions\IEvaluationContext $context = null ) : Expression[]
$expressions array
$context Pinq\Expressions\IEvaluationContext
리턴 Expression[]

staticField() 최종 공개 정적인 메소드

final public static staticField ( Expression $class, Expression $name ) : StaticFieldExpression
$class Expression
$name Expression
리턴 StaticFieldExpression

staticMethodCall() 최종 공개 정적인 메소드

final public static staticMethodCall ( Expression $class, Expression $name, array $arguments = [] ) : StaticMethodCallExpression
$class Expression
$name Expression
$arguments array
리턴 StaticMethodCallExpression

ternary() 최종 공개 정적인 메소드

final public static ternary ( Expression $condition, Expression $ifTrue = null, Expression $ifFalse ) : TernaryExpression
$condition Expression
$ifTrue Expression
$ifFalse Expression
리턴 TernaryExpression

throwExpression() 최종 공개 정적인 메소드

final public static throwExpression ( Expression $exception ) : ThrowExpression
$exception Expression
리턴 ThrowExpression

traverse() 추상적인 공개 메소드

abstract public traverse ( ExpressionWalker $walker ) : Expression
$walker ExpressionWalker
리턴 Expression

unaryOperation() 최종 공개 정적인 메소드

final public static unaryOperation ( string $unaryOperator, Expression $operand ) : UnaryOperationExpression
$unaryOperator string
$operand Expression
리턴 UnaryOperationExpression

unsetExpression() 최종 공개 정적인 메소드

final public static unsetExpression ( array $values ) : UnsetExpression
$values array
리턴 UnsetExpression

value() 최종 공개 정적인 메소드

final public static value ( mixed $value ) : ValueExpression
$value mixed
리턴 ValueExpression

variable() 최종 공개 정적인 메소드

final public static variable ( Expression $name ) : VariableExpression
$name Expression
리턴 VariableExpression

verifyAll() 최종 보호된 정적인 메소드

Verifies the supplied array only contains expressions of the supplied type.
final protected static verifyAll ( array $expressions, string $type = __CLASS__ ) : Expression[]
$expressions array
$type string
리턴 Expression[]