Method Serializer.Serializable()->_serialize()
classSerializer.Serializable
- Method
_serialize
protectedvoid_serialize(objecto,function(mixed,string,type,multiset|zero,multiset|zero:void)serializer)- Description
Dispatch function for serialization.
- Parameter
o Object to visit. Always a context of the current object.
- Parameter
serializer Function to typically be called once for every variable in the inheriting class.
This function calls _serialize_variable() once for every variable in the inheriting class, which in turn will call
serializerwith the arguments:- Argument 1
The value of the variable.
- Argument 2
The name of the variable.
- Argument 3
The declared type of the variable.
- Argument 4
The annotations directly on the variable.
- Argument 5
The effective annotations along the variable's inherit path.
Before visiting fields, the callback receives the object with the reserved name
"\0begin"; after successful completion it receives"\0end". For both events, argument 1 is the object in the selected context, argument 3 is its object type, argument 4 contains that context's own annotations, and argument 5 isUNDEFINED. These events bypass the variable hook, and are emitted even for objects without fields. Errors abort the sequence without emitting an exit event.- Note
The symbols will be listed in the order they were defined in the class.
- Note
This function is typically called via Serializer.serialize().
- See also
Serializer.serialize(), _serialize_variable(), _deserialize()