Class AmfphpCustomClassConverter

Description

Converts data from incoming packets with explicit types to custom classes.

If the vclass is not found, the object is unmodified. Sets the explicit type marker in the data of the outgoing packets. If the explicit type marker is already set in an outgoing object, the value is left as is. This works for nested objects. This is to support services and plugins setting the explicit type themselves.

  • author: Ariel Sommeria-Klein

Located in /Amfphp/Plugins/AmfphpCustomClassConverter/AmfphpCustomClassConverter.php (line 23)


	
			
Variable Summary
Method Summary
AmfphpCustomClassConverter __construct ([ $config = null])
mixed convertToTyped (mixed $obj)
mixed filterDeserializedRequest (mixed $deserializedRequest)
mixed filterDeserializedResponse (mixed $deserializedResponse)
mixed markExplicitType (mixed $obj)
Variables
array $customClassFolderPaths (line 29)

paths to folders containing custom classes(relative or absolute)

  • var: of paths
  • access: public
Methods
Constructor __construct (line 35)

constructor.

  • access: public
AmfphpCustomClassConverter __construct ([ $config = null])
  • array $config: optional key/value pairs in an associative array. Used to override default configuration values.
convertToTyped (line 81)

if the object contains an explicit type marker, this method attempts to convert it to its typed counterpart if the typed class is already available, then simply creates a new instance of it. If not, attempts to load the file from the available service folders.

If then the class is still not available, the object is not converted note: This is not a recursive function. Rather the recusrion is handled by Amfphp_Core_Amf_Util::applyFunctionToContainedObjects. must be public so that Amfphp_Core_Amf_Util::applyFunctionToContainedObjects can call it

  • access: public
mixed convertToTyped (mixed $obj)
  • mixed $obj
filterDeserializedRequest (line 54)

converts untyped objects to their typed counterparts. Loads the class if necessary

  • access: public
mixed filterDeserializedRequest (mixed $deserializedRequest)
  • mixed $deserializedRequest
filterDeserializedResponse (line 65)

looks at the outgoing packet and sets the explicit type field so that the serializer sends it properly

  • access: public
mixed filterDeserializedResponse (mixed $deserializedResponse)
  • mixed $deserializedResponse
markExplicitType (line 124)

sets the the explicit type marker on the object and its sub-objects. This is only done if it not already set, as in some cases the service class might want to do this manually.

note: This is not a recursive function. Rather the recusrion is handled by Amfphp_Core_Amf_Util::applyFunctionToContainedObjects. must be public so that Amfphp_Core_Amf_Util::applyFunctionToContainedObjects can call it

  • access: public
mixed markExplicitType (mixed $obj)
  • mixed $obj

Documentation generated on Thu, 24 Mar 2011 16:55:37 +0100 by phpDocumentor 1.4.3