Overview

Packages

  • DataTree

Classes

  • Horde_DataTree
  • Horde_DataTree_Null
  • Horde_DataTree_Sql
  • Horde_DataTreeObject
  • Overview
  • Package
  • Class
  • Tree

Class Horde_DataTreeObject

Class that can be extended to save arbitrary information as part of a stored object.

Package: DataTree
Author: Stephane Huther shuther1@free.fr
Author: Chuck Hagenbuch chuck@horde.org
Located at Horde/DataTreeObject.php
Methods summary
public
# __construct( string $name )

Horde_DataTreeObject constructor. Just sets the $name parameter.

Horde_DataTreeObject constructor. Just sets the $name parameter.

Parameters

$name
The object name.
public
# setDataTree( Horde_DataTree & $datatree )

Sets the Horde_DataTree instance used to retrieve this object.

Sets the Horde_DataTree instance used to retrieve this object.

Parameters

$datatree
A <code><a href="class-Horde_DataTree.html">Horde_DataTree</a></code> instance.
public string
# getName( )

Gets the name of this object.

Gets the name of this object.

Returns

string
The object name.
public
# setName( string $name )

Sets the name of this object.

Sets the name of this object.

NOTE: Use with caution. This may throw out of sync the cached datatree tables if not used properly.

Parameters

$name
The name to set this object's name to.
public string
# getShortName( )

Gets the short name of this object. For display purposes only.

Gets the short name of this object. For display purposes only.

Returns

string
The object's short name.
public string
# getId( )

Gets the ID of this object.

Gets the ID of this object.

Returns

string
The object's ID.
public array
# getData( )

Gets the data array.

Gets the data array.

Returns

array
The internal data array.
public
# setData( array $data )

Sets the data array.

Sets the data array.

Parameters

$data
data array to store internally.
public
# setOrder( integer $order )

Sets the order of this object in its object collection.

Sets the order of this object in its object collection.

Parameters

$order
public Horde_DataTreeObject &
# getParent( string $class = 'Horde_DataTreeObject' )

Returns this object's parent.

Returns this object's parent.

Parameters

$class
<p>Subclass of Horde_DataTreeObject to use. Defaults to Horde_DataTreeObject. Null forces the driver to look into the attributes table to determine the subclass to use. If none is found it uses Horde_DataTreeObject.</p>

Returns

Horde_DataTreeObject
This object's parent
public &
# getChild( string $name, boolean $autocreate = true )

Returns a child of this object.

Returns a child of this object.

Parameters

$name
The child's name.
$autocreate
<p>If true and no child with the given name exists, one gets created.</p>
public boolean|PEAR_Error
# save( )

Saves any changes to this object to the backend permanently. New objects are added instead.

Saves any changes to this object to the backend permanently. New objects are added instead.

Returns

boolean|PEAR_Error
PEAR_Error on failure.
public boolean|PEAR_Error
# delete( )

Delete this object from the backend permanently.

Delete this object from the backend permanently.

Returns

boolean|PEAR_Error
PEAR_Error on failure.
public mixed
# get( string $attribute )

Gets one of the attributes of the object, or null if it isn't defined.

Gets one of the attributes of the object, or null if it isn't defined.

Parameters

$attribute
The attribute to get.

Returns

mixed
The value of the attribute, or null.
public
# set( string $attribute, mixed $value )

Sets one of the attributes of the object.

Sets one of the attributes of the object.

Parameters

$attribute
The attribute to set.
$value
The value for $attribute.
Properties summary
public Horde_DataTree $datatree

This object's Horde_DataTree instance.

This object's Horde_DataTree instance.

#
public array $data

Key-value hash that will be serialized.

Key-value hash that will be serialized.

See

Horde_DataTreeObject::getData()
# array()
public string $name

The unique name of this object. These names have the same requirements as other object names - they must be unique, etc.

The unique name of this object. These names have the same requirements as other object names - they must be unique, etc.

#
public integer $order

If this object has ordering data, store it here.

If this object has ordering data, store it here.

# null
API documentation generated by ApiGen