VCL
[ class tree: VCL ] [ index: VCL ] [ all elements ]

Class: Persistent

Source Location: /classes.inc.php

Class Overview

Object
   |
   --Persistent

A base class for persistent objects which are the ones which provide the required features to be serialized/unserialized easily.


Author(s):

Methods


Child classes:

Component
Component is the common ancestor of all component classes.
ListColumn
ListColumn represents a column of a ListView.
ListItem
ListItem is an individual item of a ListView control.
TreeNode
TreeNode describes an individual node in a tree view control.
SubLabel
This is a helper class for the Label used in the LabeledEdit control
Layout
Layout encapsulation to allow any component to hold controls and render them in very different ways
Font
Font encapsulates all properties required to represent a font on the browser.
Pen
Pen is used to draw lines or outline shapes on a canvas.
Brush
Brush represents the color and pattern used to fill solid shapes.
Canvas
Canvas provides an abstract drawing space for objects that must render their own images.

Inherited Variables

Inherited Methods

Class: Object

Object::__construct()
Constructs an object and initializes its data before the object is first used.
Object::className()
Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
Object::classNameIs()
Determines whether an object is of a specific type.
Object::classParent()
Returns the type of the immediate ancestor of a class.
Object::inheritsFrom()
Determines the relationship of two object types.
Object::methodExists()
Check if a method exists declared on this object instance.
Object::readProperty()
Reads a property from the streams
Object::__get()
To virtualize properties
Object::__set()
To virtualize properties

Class Details

[line 844]
A base class for persistent objects which are the ones which provide the required features to be serialized/unserialized easily.

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.




Tags:



[ Top ]


Class Methods


method allowserialize [line 1037]

boolean allowserialize( string $propname)

This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property.

Override the filter $propname, and return false if you do not want to allow a property to be serialized.




Tags:

return:  True if the property can be serialized
see:  Persistent::serialize()


Parameters:

string   $propname   Name of the property

[ Top ]

method assign [line 891]

void assign( Persistent $source)

Assigns the source properties to this object.

This method calls the assignTo method of the source component. If $source is null, an assign error is raised.




Tags:



Parameters:

Persistent   $source   Object to get assigned to this object

[ Top ]

method assignError [line 922]

void assignError( Persistent $source)

Raises an assignation error.

$source can be null, but if not, the class name will be used to show the error and give the user more info.




Tags:



Parameters:

Persistent   $source   Component tried to assign

[ Top ]

method assignTo [line 907]

void assignTo( Persistent $dest)

Assigns this object to another object.

Override this method to implement the code required to copy one object instance into this one.




Tags:



Overridden in child classes as:

SubLabel::assignTo()
Font::assignTo()
Assign Font object to another Font object, this is done by assigning all Font properties from one object to another
Pen::assignTo()
Brush::assignTo()

Parameters:

Persistent   $dest   Object to assign this object to

[ Top ]

method inSession [line 1049]

boolean inSession( $name)

This method determines if this object exists in the current session.



Tags:

return:  True if the component exists in the session
see:  Persistent::serialize(), Persistent::readOwner(), Persistent::readNamePath()


Parameters:

   $name  

[ Top ]

method readNamePath [line 853]

string readNamePath( )

Used to serialize/unserialize. It returns the full path to identify this component.



Tags:



Overridden in child classes as:

Component::readNamePath()
Specifies the path to uniquely identify a component, qualified by the owner when required.

[ Top ]

method readOwner [line 876]

Component readOwner( )

Owner of the component.

In Persistent, it always returns null. In Component, it returns the owner of the component if assigned.




Overridden in child classes as:

Component::readOwner()
Indicates the component that is responsible for streaming and freeing this component.
SubLabel::readOwner()
Layout::readOwner()
Font::readOwner()
Pen::readOwner()
Brush::readOwner()

[ Top ]

method serialize [line 949]

void serialize( )

Stores this object into the session.

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.




Tags:



Overridden in child classes as:

DBPaginator::serialize()
CustomPage::serialize()
ListView::serialize()
CustomTreeView::serialize()
SimpleChart::serialize()
Pager::serialize()
DataSet::serialize()

[ Top ]

method unserialize [line 1067]

void 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.

To be unserialized, components need the owner to be unique on the session array. If the owner is notassigned, an exception will be raised.




Tags:



Overridden in child classes as:

DBPaginator::unserialize()
CustomListView::unserialize()
ListView::unserialize()
DBGrid::unserialize()
CustomTreeView::unserialize()
SimpleChart::unserialize()
Pager::unserialize()
DataSet::unserialize()

[ Top ]


Documentation generated on Sat, 13 Jun 2009 10:51:00 -0700 by phpDocumentor 1.4.1