PHP Class WPDKObject

This abstract class - when inerith - add a more efficent management of properties. WPDKObject is the root class of most WPDK class hierarchies. Through WPDKObject, objects inherit a basic interface to the runtime system and the ability to behave as WPDK objects.
Author: =undo= ([email protected])
Datei anzeigen Open project: wpxtreme/wpdk Class Usage Examples

Public Properties

Property Type Description
$__version string If no version has been set, the default is '1.0.0'. Version numbers are needed for decoding or unarchiving, so older versions of an object can be detected and decoded correctly.

Public Methods

Method Description
__className ( ) : string Returns the class name. Returns FALSE if called from outside a class.
__delta ( mixed $last_version, mixed $old_version ) : Object Do a merge/combine between two object tree.
__dump ( mixed $var, boolean $monitor = false ) Useful static method to dump any variable with a
 HTML tag wrap    
__isClass ( string $class ) : boolean Return TRUE if the instance is an instance of $class.
__isSubclassOfClass ( object $class ) : boolean Returns a Boolean value that indicates whether the receiving class is a subclass of, or identical to, a given class.
__parentClass ( ) : string Returns the name of the parent class of the class of which object is an instance or the name.
delta ( $last_version, $old_version )

Method Details

__className() public method

Returns the class name. Returns FALSE if called from outside a class.
Since: 1.2.0
public __className ( ) : string
return string

__delta() public static method

If the old version not contains an object or property, that is added. If the old version contains an object or property less in last version, that is deleted.
Since: 1.2.0
public static __delta ( mixed $last_version, mixed $old_version ) : Object
$last_version mixed Object tree with new or delete object/value
$old_version mixed Current Object tree, loaded from serialize or database for example
return Object the delta Object tree

__dump() public static method

Useful static method to dump any variable with a
 HTML tag wrap        
Since: 1.3.0
public static __dump ( mixed $var, boolean $monitor = false )
$var mixed Some variable
$monitor boolean Optional. If true a old style monitor layout is displayed

__isClass() public method

This method is different from is_a(): class a extends WPDKObject } class b extends a } $b = new b(); echo is_a( $b, 'a' ); // TRUE echo $b->__isClass( 'a' ); // FALSE
Since: 1.2.0
public __isClass ( string $class ) : boolean
$class string Class name
return boolean

__isSubclassOfClass() public method

class a extends WPDKObject } class b extends a } $b = new b(); echo $b->__isSubclassOfClass( 'a' ); // TRUE echo $b->__isSubclassOfClass( 'WPDKObject' ); // TRUE
Since: 1.2.0
public __isSubclassOfClass ( object $class ) : boolean
$class object A class object
return boolean

__parentClass() public method

Returns the name of the parent class of the class of which object is an instance or the name.
Since: 1.2.0
public __parentClass ( ) : string
return string

delta() public static method

Deprecation: since 1.4.8 - use __delta() instead
public static delta ( $last_version, $old_version )

Property Details

$__version public_oe property

If no version has been set, the default is '1.0.0'. Version numbers are needed for decoding or unarchiving, so older versions of an object can be detected and decoded correctly.
Since: 1.2.0
public string $__version
return string