Property | Type | Description | |
---|---|---|---|
$dateClass | |||
$falseValues | |||
$inflector | |||
$properties | |||
$trueValues | |||
$value |
Method | Description | |
---|---|---|
__construct ( |
Instantiates a new Caster. | |
castBinary ( ) : string | Casts the given $value to a binary. | |
castBoolean ( ) : boolean | Casts the given $value to boolean or tries to guess if it's an implicit boolean value, like the string 'true'. | |
castByte ( ) : mixed | Casts the given $value to a byte. | |
castDate ( ) : DateTime | Casts the given $value to a DateTime object. | |
castDateTime ( ) : DateTime | Casts the given $value to a DateTime object. | |
castDecimal ( ) : integer | Casts the internal value to an integer cmprehended between a range of accepted integers. | |
castDouble ( ) : float | Casts the given $value to a double (well. | |
castEmbedded ( ) : mixed | Given an embedded record, it uses the manager to hydrate it. | |
castEmbeddedArrays ( ) : Array | Casts embedded arrays, given the $cast property of the internal annotation. | |
castEmbeddedList ( ) : Array | Casts a list of embedded entities | |
castEmbeddedMap ( ) : Array | Casts a map (key-value preserved) of embedded entities | |
castEmbeddedSet ( ) : Array | Casts a set of embedded entities | |
castFloat ( ) : float | Casts the value to a float. | |
castInBuffer ( integer $limit, string $type ) : integer | Casts the current value into an integer verifying it belongs to a certain range ( -$limit < $value > + $limit ). | |
castInteger ( ) : integer | Casts the value into an integer. | |
castLink ( ) : Doctrine\ODM\OrientDB\Proxy\Proxy | ||
castLinklist ( ) : Array | Hydrates multiple objects through a Mapper. | |
castLinkmap ( ) : Array | Hydrates multiple objects through a Mapper. | |
castLinkset ( ) : Array | Hydrates multiple objects through a Mapper. | |
castLong ( ) : mixed | Casts the given $value to a long. | |
castNone ( ) : mixed | This function is mostly for embedded arrays of mixed type as it is primarily just a way to bypass the caster | |
castShort ( ) : mixed | Casts the value to a short. | |
castString ( ) : string | Casts the value to string. | |
setProperty ( string $key, mixed $property ) | Defines properties that can be internally used by the caster. | |
setValue ( mixed $value ) | Sets the internal value to work with. |
Method | Description | |
---|---|---|
assignDateClass ( string $class ) | Assigns the class used to cast dates and datetimes. | |
castArrayOf ( string $type ) : Array | Given a $type, it casts each element of the value array with a method. | |
castLinkCollection ( ) : Array | null | Given the internal value of the caster (an array), it iterates over each element of the array and hydrates it. | |
convertJsonCollectionToArray ( ) | If a JSON value is converted in an object containing other objects to hydrate, this method converts the main object in an array. | |
getDateClass ( ) : string | Returns the class used to cast date and datetimes. | |
getHydrator ( ) : |
Returns the hydrator. | |
getProperty ( string $key ) : mixed | Returns a property of the Caster, given its $key. | |
handleMismatch ( Closure $castFunction, $expectedType ) | ||
raiseMismatch ( $expectedType ) | Throws an exception whenever $value can not be casted as $expectedType. |
public __construct ( |
||
$hydrator | ||
$inflector | ||
$value | mixed | |
$dateClass | string | The class used to cast dates and datetimes |
protected assignDateClass ( string $class ) | ||
$class | string |
protected castArrayOf ( string $type ) : Array | ||
$type | string | |
return | Array |
public castBinary ( ) : string | ||
return | string |
public castBoolean ( ) : boolean | ||
return | boolean |
public castDate ( ) : DateTime | ||
return | DateTime |
public castDateTime ( ) : DateTime | ||
return | DateTime |
public castDecimal ( ) : integer | ||
return | integer |
public castEmbedded ( ) : mixed | ||
return | mixed |
public castEmbeddedArrays ( ) : Array | ||
return | Array |
public castEmbeddedList ( ) : Array | ||
return | Array |
public castEmbeddedMap ( ) : Array | ||
return | Array |
public castEmbeddedSet ( ) : Array | ||
return | Array |
public castInteger ( ) : integer | ||
return | integer |
public castLink ( ) : Doctrine\ODM\OrientDB\Proxy\Proxy | ||
return | Doctrine\ODM\OrientDB\Proxy\Proxy |
protected castLinkCollection ( ) : Array | null | ||
return | Array | null |
public castLinklist ( ) : Array | ||
return | Array |
public castLinkmap ( ) : Array | ||
return | Array |
public castLinkset ( ) : Array | ||
return | Array |
protected convertJsonCollectionToArray ( ) |
protected getDateClass ( ) : string | ||
return | string |
protected getHydrator ( ) : |
||
return |
protected getProperty ( string $key ) : mixed | ||
$key | string | |
return | mixed |
protected handleMismatch ( Closure $castFunction, $expectedType ) | ||
$castFunction | Closure |
protected raiseMismatch ( $expectedType ) |
public setProperty ( string $key, mixed $property ) | ||
$key | string | |
$property | mixed |