PHP Класс 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.
Автор: =undo= ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$__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.

Открытые методы

Метод Описание
__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 )

Описание методов

__className() публичный Метод

Returns the class name. Returns FALSE if called from outside a class.
С версии: 1.2.0
public __className ( ) : string
Результат string

__delta() публичный статический Метод

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.
С версии: 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
Результат Object the delta Object tree

__dump() публичный статический Метод

Useful static method to dump any variable with a
 HTML tag wrap        
С версии: 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() публичный Метод

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
С версии: 1.2.0
public __isClass ( string $class ) : boolean
$class string Class name
Результат boolean

__isSubclassOfClass() публичный Метод

class a extends WPDKObject } class b extends a } $b = new b(); echo $b->__isSubclassOfClass( 'a' ); // TRUE echo $b->__isSubclassOfClass( 'WPDKObject' ); // TRUE
С версии: 1.2.0
public __isSubclassOfClass ( object $class ) : boolean
$class object A class object
Результат boolean

__parentClass() публичный Метод

Returns the name of the parent class of the class of which object is an instance or the name.
С версии: 1.2.0
public __parentClass ( ) : string
Результат string

delta() публичный статический Метод

Устаревший: since 1.4.8 - use __delta() instead
public static delta ( $last_version, $old_version )

Описание свойств

$__version публичное свойство

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.
С версии: 1.2.0
public string $__version
Результат string