PHP Класс Doctrine\ODM\OrientDB\Caster\Caster

Наследование: implements Doctrine\ODM\OrientDB\Caster\CasterInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$dateClass
$falseValues
$inflector
$properties
$trueValues
$value

Открытые методы

Метод Описание
__construct ( Hydrator $hydrator, Cached $inflector, mixed $value = null, string $dateClass = '\DateTime' ) 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.

Защищенные методы

Метод Описание
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 ( ) : Hydrator 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.

Описание методов

__construct() публичный Метод

Instantiates a new Caster.
public __construct ( Hydrator $hydrator, Cached $inflector, mixed $value = null, string $dateClass = '\DateTime' )
$hydrator Doctrine\ODM\OrientDB\Mapper\Hydration\Hydrator
$inflector Doctrine\OrientDB\Util\Inflector\Cached
$value mixed
$dateClass string The class used to cast dates and datetimes

assignDateClass() защищенный Метод

If the $class is a subclass of \DateTime, it uses it, it uses \DateTime otherwise.
protected assignDateClass ( string $class )
$class string

castArrayOf() защищенный Метод

Given a $type, it casts each element of the value array with a method.
protected castArrayOf ( string $type ) : Array
$type string
Результат Array

castBinary() публичный Метод

Casts the given $value to a binary.
public castBinary ( ) : string
Результат string

castBoolean() публичный Метод

Casts the given $value to boolean or tries to guess if it's an implicit boolean value, like the string 'true'.
public castBoolean ( ) : boolean
Результат boolean

castByte() публичный Метод

Casts the given $value to a byte.
public castByte ( ) : mixed
Результат mixed

castDate() публичный Метод

If the value was stored as a timestamp, it sets the value to the DateTime object via the setTimestamp method.
public castDate ( ) : DateTime
Результат DateTime

castDateTime() публичный Метод

Casts the given $value to a DateTime object.
public castDateTime ( ) : DateTime
Результат DateTime

castDecimal() публичный Метод

Casts the internal value to an integer cmprehended between a range of accepted integers.
public castDecimal ( ) : integer
Результат integer

castDouble() публичный Метод

.. float).
public castDouble ( ) : float
Результат float

castEmbedded() публичный Метод

Given an embedded record, it uses the manager to hydrate it.
public castEmbedded ( ) : mixed
Результат mixed

castEmbeddedArrays() публичный Метод

Casts embedded arrays, given the $cast property of the internal annotation.
public castEmbeddedArrays ( ) : Array
Результат Array

castEmbeddedList() публичный Метод

Casts a list of embedded entities
public castEmbeddedList ( ) : Array
Результат Array

castEmbeddedMap() публичный Метод

Casts a map (key-value preserved) of embedded entities
public castEmbeddedMap ( ) : Array
Результат Array

castEmbeddedSet() публичный Метод

Casts a set of embedded entities
public castEmbeddedSet ( ) : Array
Результат Array

castFloat() публичный Метод

Casts the value to a float.
public castFloat ( ) : float
Результат float

castInBuffer() публичный Метод

Casts the current value into an integer verifying it belongs to a certain range ( -$limit < $value > + $limit ).
public castInBuffer ( integer $limit, string $type ) : integer
$limit integer
$type string
Результат integer

castInteger() публичный Метод

Casts the value into an integer.
public castInteger ( ) : integer
Результат integer

castLinkCollection() защищенный Метод

Given the internal value of the caster (an array), it iterates over each element of the array and hydrates it.
См. также: Caster::castLink for more insights
protected castLinkCollection ( ) : Array | null
Результат Array | null

castLinkmap() публичный Метод

A conversion needs to be done because of the non linearity of a JSON collection compared to a PHP array.
public castLinkmap ( ) : Array
Результат Array

castLinkset() публичный Метод

Hydrates multiple objects through a Mapper.
public castLinkset ( ) : Array
Результат Array

castLong() публичный Метод

Casts the given $value to a long.
public castLong ( ) : mixed
Результат mixed

castNone() публичный Метод

This function is mostly for embedded arrays of mixed type as it is primarily just a way to bypass the caster
public castNone ( ) : mixed
Результат mixed

castShort() публичный Метод

Casts the value to a short.
public castShort ( ) : mixed
Результат mixed

castString() публичный Метод

Casts the value to string.
public castString ( ) : string
Результат string

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() защищенный Метод

Returns the class used to cast date and datetimes.
protected getDateClass ( ) : string
Результат string

getHydrator() защищенный Метод

Returns the hydrator.
protected getHydrator ( ) : Hydrator
Результат Doctrine\ODM\OrientDB\Mapper\Hydration\Hydrator

getProperty() защищенный Метод

Returns a property of the Caster, given its $key.
protected getProperty ( string $key ) : mixed
$key string
Результат mixed

handleMismatch() защищенный Метод

protected handleMismatch ( Closure $castFunction, $expectedType )
$castFunction Closure

raiseMismatch() защищенный Метод

Throws an exception whenever $value can not be casted as $expectedType.
protected raiseMismatch ( $expectedType )

setProperty() публичный Метод

Defines properties that can be internally used by the caster.
public setProperty ( string $key, mixed $property )
$key string
$property mixed

setValue() публичный Метод

Sets the internal value to work with.
public setValue ( mixed $value )
$value mixed

Описание свойств

$dateClass защищенное свойство

protected $dateClass

$falseValues защищенное свойство

protected $falseValues

$inflector защищенное свойство

protected $inflector

$properties защищенное свойство

protected $properties

$trueValues защищенное свойство

protected $trueValues

$value защищенное свойство

protected $value