Amf/Parse/Amf0/Serializer.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Amf
- Subpackage
- Parse_Amf0
- Version
- $Id: Serializer.php 25179 2012-12-22 21:29:30Z rob $
\Zend_Amf_Parse_Amf0_Serializer
Serializer PHP misc types back to there corresponding AMF0 Type Marker.
- Parent(s)
- \Zend_Amf_Parse_Serializer
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
- \global\Zend_Amf_Parse_Serializer
Properties

array $_referenceObjects = array()An array of reference objects
array()Details- Type
- array

string $_stream = Reference to the current output stream being constructed
Inherited from: \Zend_Amf_Parse_Serializer::$$_stream- Type
- string
- Inherited_from
- \Zend_Amf_Parse_Serializer::$$_stream

bool $mbStringFunctionsOverloaded = str* functions overloaded using mbstring.func_overload
Inherited from: \Zend_Amf_Parse_Serializer::$$mbStringFunctionsOverloaded- Type
- bool
- Inherited_from
- \Zend_Amf_Parse_Serializer::$$mbStringFunctionsOverloaded
Methods

__construct(\Zend_Amf_Parse_OutputStream $stream) : void
| Name | Type | Description |
|---|---|---|
| $stream | \Zend_Amf_Parse_OutputStream |

getClassName(object $object) : false | stringFind if the class name is a class mapped name and return the respective classname if it is.
| Name | Type | Description |
|---|---|---|
| $object | object |
| Type | Description |
|---|---|
| false | string | $className |

writeAmf3TypeMarker(string $data) : \Zend_Amf_Parse_Amf0_SerializerEncountered and AMF3 Type Marker use AMF3 serializer.
Once AMF3 is encountered it will not return to AMf0.
| Name | Type | Description |
|---|---|---|
| $data | string |
| Type | Description |
|---|---|
| \Zend_Amf_Parse_Amf0_Serializer |

writeArray(array $array) : \Zend_Amf_Parse_Amf0_SerializerWrite a standard numeric array to the output stream.
If a mixed array is encountered call writeTypeMarker with mixed array.
| Name | Type | Description |
|---|---|---|
| $array | array |
| Type | Description |
|---|---|
| \Zend_Amf_Parse_Amf0_Serializer |

writeDate(\DateTime | \Zend_Date $data) : \Zend_Amf_Parse_Amf0_SerializerConvert the DateTime into an AMF Date
| Name | Type | Description |
|---|---|---|
| $data | \DateTime | \Zend_Date |
| Type | Description |
|---|---|
| \Zend_Amf_Parse_Amf0_Serializer |

writeObject( $object) : \Zend_Amf_Parse_Amf0_SerializerWrite a PHP array with string or mixed keys.
| Name | Type | Description |
|---|---|---|
| $object |
| Type | Description |
|---|---|
| \Zend_Amf_Parse_Amf0_Serializer |

writeObjectReference(mixed $object, string $markerType, mixed $objectByVal = false) : BooleanCheck if the given object is in the reference table, write the reference if it exists, otherwise add the object to the reference table
| Name | Type | Description |
|---|---|---|
| $object | mixed | object reference to check for reference |
| $markerType | string | AMF type of the object to write |
| $objectByVal | mixed | object to check for reference |
| Type | Description |
|---|---|
| Boolean | true, if the reference was written, false otherwise |

writeTypeMarker(mixed $data, mixed $markerType = null, mixed $dataByVal = false) : \Zend_Amf_Parse_Amf0_SerializerDetermine type and serialize accordingly
Checks to see if the type was declared and then either auto negotiates the type or relies on the user defined markerType to serialize the data into amf
| Name | Type | Description |
|---|---|---|
| $data | mixed | |
| $markerType | mixed | |
| $dataByVal | mixed |
| Type | Description |
|---|---|
| \Zend_Amf_Parse_Amf0_Serializer |
| Exception | Description |
|---|---|
| \Zend_Amf_Exception | for unrecognized types or data |

writeTypedObject(object $data) : \Zend_Amf_Parse_Amf0_SerializerWrite a class mapped object to the output stream.
| Name | Type | Description |
|---|---|---|
| $data | object |
| Type | Description |
|---|---|
| \Zend_Amf_Parse_Amf0_Serializer |