Object | --Persistent
Located in File: /classes.inc.php
If you want to create a component that has persistance capabilities, you can inherit from this class to get all the mecanisms you need. The internal session handling uses properties and methods found on this class to serialize/unserialize components to the session and recover application state.
![]() | NamePath | Used to serialize/unserialize. It returns the full path to identify this component. |
![]() | Owner | Owner of the component. |
property NamePath (line 853)
property Owner (line 876)
In Persistent, it always returns null. In Component, it returns the owner of the component if assigned.
| allowserialize | This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property. |
| assign | Assigns the source properties to this object. |
| assignError | Raises an assignation error. |
| assignTo | Assigns this object to another object. |
| inSession | This method determines if this object exists in the current session. |
| serialize | Stores this object into the session. |
| unserialize | This method uses PHP reflection to iterate through published properties (the ones starting with get) and retrieve the properties stored by a previous serialize() call. |
Defined in class Object |
||
![]() | __construct | Constructs an object and initializes its data before the object is first used. |
![]() | className | Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument). |
![]() | classParent | Returns the type of the immediate ancestor of a class. |
Method allowserialize (line 1037)
Override the filter $propname, and return false if you do not want to allow a property to be serialized.
Method assign (line 891)
This method calls the assignTo method of the source component. If $source is null, an assign error is raised.
Method assignError (line 922)
$source can be null, but if not, the class name will be used to show the error and give the user more info.
Method assignTo (line 907)
Override this method to implement the code required to copy one object instance into this one.
Method inSession (line 1049)
Method serialize (line 949)
It uses PHP reflection to get the published properties that will be stored. Component persistance is achieved by iterating through all published properties (the ones starting with get) and storing that value into the session.
Those values are retrieved at the right time to recover the component state.
To be serialized, components need an owner to be unique on the session array. If an owner is not assigned, an exception will be raised.
Method unserialize (line 1067)
To be unserialized, components need the owner to be unique on the session array. If the owner is notassigned, an exception will be raised.