Class DataTree_null

Description

The DataTree_null:: class provides a dummy implementation of the DataTree:: API; no data will last beyond a single page request.

$Horde: framework/DataTree/DataTree/null.php,v 1.15.2.8 2009/01/06 15:23:02 jan Exp $

Copyright 1999-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /DataTree/DataTree/null.php (line 18)

DataTree
   |
   --DataTree_null
Variable Summary
Method Summary
 void add ( $object, mixed $fullname)
 void countByAttributes (array $criteria, [string $parent = DATATREE_ROOT], [boolean $allLevels = true], [string $restrict = 'name'])
 void getAttributes (integer $cid)
 array getAttributeValues ([string $attribute_name = null], [string $attribute_key = null], [string $parent = DATATREE_ROOT], [boolean $allLevels = true])
 void getByAttributes (array $criteria, [string $parent = DATATREE_ROOT], [boolean $allLevels = true], [string $restrict = 'name'], [integer $from = 0], [integer $count = 0], [string $sortby_name = null], [string $sortby_key = null], [integer $direction = 0])
 void getData (integer $cid)
 array getSortedTree (string $root, [boolean $loadTree = false], [array $sortby_name = null], [array $sortby_key = null], [array $direction = 0])
 void move (mixed $object, [string $newparent = null])
 void remove (mixed $object, [boolean $force = false])
 void removeByIds (array $ids)
 void removeByNames (array $names)
 void rename (mixed $old_object, string $new_object_name)
 void reorder (string $parents, [mixed $order = null], [integer $cid = null])
 void setOrder (integer $id, integer $order)
 array sortByAttributes (array $unordered_ids, [array $sortby_name = null], [array $sortby_key = null], [array $direction = 0])
 void updateData (string $object)
 boolean _exists (string $object_name)
 integer _getId (string $name)
 string _getName (integer $id)
 boolean _init ()
Variables
array $_attributeCache = array() (line 25)

Cache of attributes for any objects created during this page request.

array $_dataCache = array() (line 32)

Cache of data for any objects created during this page request.

Inherited Variables

Inherited from DataTree

DataTree::$_data
DataTree::$_nameMap
DataTree::$_params
DataTree::$_sortHash
Methods
add (line 129)

Add an object. Part of the DataTree API that must be overridden by subclasses.

void add ( $object, mixed $fullname)
  • mixed $fullname: The object to add (string or DataTreeObject).
  • $object

Redefinition of:
DataTree::add()
Adds an object.
countByAttributes (line 301)

Returns the number of objects matching a set of attribute criteria.

  • see: buildAttributeQuery()
void countByAttributes (array $criteria, [string $parent = DATATREE_ROOT], [boolean $allLevels = true], [string $restrict = 'name'])
  • array $criteria: The array of criteria.
  • string $parent: The parent node to start searching from.
  • boolean $allLevels: Return all levels, or just the direct children of $parent? Defaults to all levels.
  • string $restrict: Only return attributes with the same attribute_name or attribute_id.

Redefinition of:
DataTree::countByAttributes()
Returns the number of objects matching a set of attribute criteria.
getAttributes (line 270)

Retrieve data for an object.

void getAttributes (integer $cid)
  • integer $cid: The object id to fetch.

Redefinition of:
DataTree::getAttributes()
Retrieve data for an object from the horde_datatree_attributes table.
getAttributeValues (line 374)

Returns a list of all of the available values of the given attribute name/key combination. Either attribute_name or attribute_key MUST be supplied, and both MAY be supplied.

  • return: An array of all of the available values.
array getAttributeValues ([string $attribute_name = null], [string $attribute_key = null], [string $parent = DATATREE_ROOT], [boolean $allLevels = true])
  • string $attribute_name: The name of the attribute.
  • string $attribute_key: The key value of the attribute.
  • string $parent: The parent node to start searching from.
  • boolean $allLevels: Return all levels, or just the direct children of $parent?
getByAttributes (line 329)

Returns a set of object ids based on a set of attribute criteria.

  • see: buildAttributeQuery()
void getByAttributes (array $criteria, [string $parent = DATATREE_ROOT], [boolean $allLevels = true], [string $restrict = 'name'], [integer $from = 0], [integer $count = 0], [string $sortby_name = null], [string $sortby_key = null], [integer $direction = 0])
  • array $criteria: The array of criteria.
  • string $parent: The parent node to start searching from.
  • boolean $allLevels: Return all levels, or just the direct children of $parent? Defaults to all levels.
  • string $restrict: Only return attributes with the same attribute_name or attribute_id.
  • integer $from: The object to start to fetching
  • integer $count: The number of objects to fetch
  • string $sortby_name: Attribute name to use for sorting.
  • string $sortby_key: Attribute key to use for sorting.
  • integer $direction: Sort direction:
    1. - ascending
    2. - descending

Redefinition of:
DataTree::getByAttributes()
Returns a set of object ids based on a set of attribute criteria.
getData (line 258)

Retrieve data for an object from the datatree_data field.

void getData (integer $cid)
  • integer $cid: The object id to fetch, or an array of object ids.

Redefinition of:
DataTree::getData()
Retrieve data for an object from the datatree_data field.
getSortedTree (line 118)

Get a tree sorted by the specified attribute name and/or key.

  • return: TODO
  • since: Horde 3.1
array getSortedTree (string $root, [boolean $loadTree = false], [array $sortby_name = null], [array $sortby_key = null], [array $direction = 0])
  • string $root: Which portion of the tree to sort. Defaults to all of it.
  • boolean $loadTree: Sort the tree starting at $root, or just the requested level and direct parents? Defaults to single level.
  • array $sortby_name: Attribute name to use for sorting.
  • array $sortby_key: Attribute key to use for sorting.
  • array $direction: Sort direction:
    1. - ascending
    2. - descending

Redefinition of:
DataTree::getSortedTree()
Returns a tree sorted by the specified attribute name and/or key.
move (line 239)

Move an object to a new parent.

void move (mixed $object, [string $newparent = null])
  • mixed $object: The object to move.
  • string $newparent: The new parent object. Defaults to the root.

Redefinition of:
DataTree::move()
Move an object to a new parent.
remove (line 201)

Removes an object.

void remove (mixed $object, [boolean $force = false])
  • mixed $object: The object to remove.
  • boolean $force: Force removal of every child object?

Redefinition of:
DataTree::remove()
Removes an object.
removeByIds (line 215)

Remove one or more objects by id. This function does *not* do

the validation, reordering, etc. that remove() does. If you need to check for children, re-do ordering, etc., then you must remove() objects one-by-one. This is for code that knows it's dealing with single (non-parented) objects and needs to delete a batch of them quickly.

void removeByIds (array $ids)
  • array $ids: The objects to remove.
removeByNames (line 229)

Remove one or more objects by name. This function does *not* do

the validation, reordering, etc. that remove() does. If you need to check for children, re-do ordering, etc., then you must remove() objects one-by-one. This is for code that knows it's dealing with single (non-parented) objects and needs to delete a batch of them quickly.

void removeByNames (array $names)
  • array $names: The objects to remove.
rename (line 249)

Change an object's name.

void rename (mixed $old_object, string $new_object_name)
  • mixed $old_object: The old object.
  • string $new_object_name: The new object name.

Redefinition of:
DataTree::rename()
Change an object's name.
reorder (line 177)

Change order of the children of an object.

void reorder (string $parents, [mixed $order = null], [integer $cid = null])
  • string $parents: The parent id string path.
  • mixed $order: A specific new order position or an array containing the new positions for the given $parents object.
  • integer $cid: If provided indicates insertion of a new child to the object, and will be used to avoid incrementing it when shifting up all other children's order. If not provided indicates deletion, hence shift all other positions down one.

Redefinition of:
DataTree::reorder()
Changes the order of the children of an object.
setOrder (line 191)

Explicitly set the order for a datatree object.

void setOrder (integer $id, integer $order)
  • integer $id: The datatree object id to change.
  • integer $order: The new order.

Redefinition of:
DataTree::setOrder()
Explicitly set the order for a datatree object.
sortByAttributes (line 356)

Sorts IDs by attribute values. IDs without attributes will be added to the end of the sorted list.

  • return: Sorted ids.
array sortByAttributes (array $unordered_ids, [array $sortby_name = null], [array $sortby_key = null], [array $direction = 0])
  • array $unordered_ids: Array of ids to sort.
  • array $sortby_name: Attribute name to use for sorting.
  • array $sortby_key: Attribute key to use for sorting.
  • array $direction: Sort direction:
    1. - ascending
    2. - descending

Redefinition of:
DataTree::sortByAttributes()
Sorts IDs by attribute values. IDs without attributes will be added to the end of the sorted list.
updateData (line 385)

Update the data in an object. Does not change the object's parent or name, just serialized data.

void updateData (string $object)
  • string $object: The object.

Redefinition of:
DataTree::updateData()
Update the data in an object. Does not change the object's parent or name, just serialized data or attributes.
_exists (line 71)

Check for existance of an object in a backend-specific manner.

  • return: True if the object exists, false otherwise.
boolean _exists (string $object_name)
  • string $object_name: Object name to check for.
_getId (line 83)

Look up a datatree id by name.

  • return: DataTree id
integer _getId (string $name)
  • string $name
_getName (line 95)

Look up a datatree name by id.

  • return: DataTree name
string _getName (integer $id)
  • integer $id
_init (line 412)

Init the object.

  • return: True.
boolean _init ()

Inherited Methods

Inherited From DataTree

 DataTree::DataTree()
 DataTree::add()
 DataTree::count()
 DataTree::countByAttributes()
 DataTree::encodeName()
 DataTree::exists()
 DataTree::factory()
 DataTree::get()
 DataTree::getAttributes()
 DataTree::getByAttributes()
 DataTree::getById()
 DataTree::getData()
 DataTree::getGroups()
 DataTree::getId()
 DataTree::getName()
 DataTree::getNumberOfChildren()
 DataTree::getObject()
 DataTree::getObjectById()
 DataTree::getObjects()
 DataTree::getOrder()
 DataTree::getParam()
 DataTree::getParent()
 DataTree::getParentById()
 DataTree::getParentIdString()
 DataTree::getParentList()
 DataTree::getParents()
 DataTree::getShortName()
 DataTree::getSortedTree()
 DataTree::move()
 DataTree::remove()
 DataTree::removeUserData()
 DataTree::rename()
 DataTree::reorder()
 DataTree::set()
 DataTree::setOrder()
 DataTree::singleton()
 DataTree::sortByAttributes()
 DataTree::sortHash()
 DataTree::updateData()
 DataTree::_add()
 DataTree::_cmp()
 DataTree::_cmpSorted()
 DataTree::_defineObjectClass()
 DataTree::_extractOneLevel()
 DataTree::_reorder()

Documentation generated on Sun, 30 Jan 2011 05:20:01 +0000 by phpDocumentor 1.4.3