\Cake\Database\TypeExpressionTypeCasterTrait

Offers a method to convert values to ExpressionInterface objects if the type they should be converted to implements ExpressionTypeInterface

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
_castToExpression()
_requiresToExpressionCasting()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

_castToExpression()

_castToExpression(mixed  $value, string  $type) : mixed

Conditionally converts the passed value to an ExpressionInterface object if the type class implements the ExpressionTypeInterface. Otherwise, returns the value unmodified.

Parameters

mixed $value

The value to converto to ExpressionInterface

string $type

The type name

Returns

mixed

_requiresToExpressionCasting()

_requiresToExpressionCasting(array  $types) : array

Returns an array with the types that require values to be casted to expressions, out of the list of type names passed as parameter.

Parameters

array $types

List of type names

Returns

array