Methods summary
public
mixed
|
#
_load( string $root = null, boolean $reload = false )
Load (a subset of) the datatree into the $_data array. Part of the
Horde_DataTree API that must be overridden by subclasses.
Load (a subset of) the datatree into the $_data array. Part of the
Horde_DataTree API that must be overridden by subclasses.
Parameters
- $root
- <p>Which portion of the tree to load. Defaults to
all of it.</p>
- $reload
- Re-load already loaded values?
Returns
mixed True on success or a PEAR_Error on failure.
|
public
mixed
|
#
_loadById( integer $cid )
Load a specific object identified by its unique ID ($id), and
its parents, into the $_data array.
Load a specific object identified by its unique ID ($id), and
its parents, into the $_data array.
Parameters
- $cid
- The unique ID of the object to load.
Returns
mixed True on success or a PEAR_Error on failure.
|
public
boolean
|
#
_exists( string $object_name )
Check for existance of an object in a backend-specific manner.
Check for existance of an object in a backend-specific manner.
Parameters
- $object_name
- Object name to check for.
Returns
boolean True if the object exists, false otherwise.
|
public
integer
|
#
_getId( string $name )
Look up a datatree id by name.
Look up a datatree id by name.
Parameters
Returns
integer Horde_DataTree id
|
public
string
|
#
_getName( integer $id )
Look up a datatree name by id.
Look up a datatree name by id.
Parameters
Returns
string Horde_DataTree name
|
public
array
|
#
getSortedTree( string $root, boolean $loadTree = false, array $sortby_name = null, array $sortby_key = null, array $direction = 0 )
Get a tree sorted by the specified attribute name and/or key.
Get a tree sorted by the specified attribute name and/or key.
Parameters
- $root
- <p>Which portion of the tree to sort.
Defaults to all of it.</p>
- $loadTree
- <p>Sort the tree starting at $root, or just the
requested level and direct parents?
Defaults to single level.</p>
- $sortby_name
- Attribute name to use for sorting.
- $sortby_key
- Attribute key to use for sorting.
- $direction
- <p>Sort direction:
0 - ascending
1 - descending</p>
Returns
array TODO
Overrides
|
public
TODO
|
#
add( mixed $object )
Add an object. Part of the Horde_DataTree API that must be
overridden by subclasses.
Add an object. Part of the Horde_DataTree API that must be
overridden by subclasses.
Parameters
- $object
- $fullname The object to add (string or Horde_DataTreeObject).
Returns
TODO
Overrides
|
public
TODO
|
#
reorder( string $parents, mixed $order = null, integer $cid = null )
Change order of the children of an object.
Change order of the children of an object.
Parameters
- $parents
- The parent id string path.
- $order
- <p>A specific new order position or an array
containing the new positions for the given
$parents object.</p>
- $cid
- <p>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.</p>
Returns
TODO
Overrides
|
public
TODO
|
#
setOrder( integer $id, integer $order )
Explicitly set the order for a datatree object.
Explicitly set the order for a datatree object.
Parameters
- $id
- The datatree object id to change.
- $order
- The new order.
Returns
TODO
Overrides
|
public
TODO
|
#
remove( mixed $object, boolean $force = false )
Removes an object.
Parameters
- $object
- The object to remove.
- $force
- Force removal of every child object?
Returns
TODO
Overrides
|
public
|
#
removeByIds( array $ids )
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.
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.
Parameters
- $ids
- The objects to remove.
|
public
|
#
removeByNames( array $names )
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.
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.
Parameters
- $names
- The objects to remove.
|
public
mixed
|
#
move( mixed $object, string $newparent = null )
Move an object to a new parent.
Move an object to a new parent.
Parameters
- $object
- The object to move.
- $newparent
- The new parent object. Defaults to the root.
Returns
mixed True on success, PEAR_Error on error.
Overrides
|
public
mixed
|
#
rename( mixed $old_object, string $new_object_name )
Change an object's name.
Parameters
- $old_object
- The old object.
- $new_object_name
- The new object name.
Returns
mixed True on success, PEAR_Error on error.
Overrides
|
public
TODO
|
#
getData( integer $cid )
Retrieve data for an object from the datatree_data field.
Retrieve data for an object from the datatree_data field.
Parameters
- $cid
- The object id to fetch, or an array of object ids.
Returns
TODO
Overrides
|
public
array
|
#
getAttributes( integer $cid )
Retrieve data for an object.
Retrieve data for an object.
Parameters
- $cid
- The object id to fetch.
Returns
array A hash of attributes, or a multi-level hash
of object ids => their attributes.
Overrides
|
public
TODO
|
#
countByAttributes( array $criteria, string $parent = DATATREE_ROOT, boolean $allLevels = true, string $restrict = 'name' )
Returns the number of objects matching a set of attribute
criteria.
Returns the number of objects matching a set of attribute
criteria.
Parameters
- $criteria
- The array of criteria.
- $parent
- The parent node to start searching from.
- $allLevels
- <p>Return all levels, or just the direct
children of $parent? Defaults to all levels.</p>
- $restrict
- <p>Only return attributes with the same
attribute_name or attribute_id.</p>
Returns
TODO
See
buildAttributeQuery()
Overrides
|
public
TODO
|
#
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 )
Returns a set of object ids based on a set of attribute criteria.
Returns a set of object ids based on a set of attribute criteria.
Parameters
- $criteria
- The array of criteria.
- $parent
- The parent node to start searching from.
- $allLevels
- <p>Return all levels, or just the direct
children of $parent? Defaults to all levels.</p>
- $restrict
- <p>Only return attributes with the same
attribute_name or attribute_id.</p>
- $from
- The object to start to fetching
- $count
- The number of objects to fetch
- $sortby_name
- Attribute name to use for sorting.
- $sortby_key
- Attribute key to use for sorting.
- $direction
- <p>Sort direction:
0 - ascending
1 - descending</p>
Returns
TODO
See
buildAttributeQuery()
Overrides
|
public
array
|
#
sortByAttributes( array $unordered_ids, array $sortby_name = null, array $sortby_key = null, array $direction = 0 )
Sorts IDs by attribute values. IDs without attributes will be
added to the end of the sorted list.
Sorts IDs by attribute values. IDs without attributes will be
added to the end of the sorted list.
Parameters
- $unordered_ids
- Array of ids to sort.
- $sortby_name
- Attribute name to use for sorting.
- $sortby_key
- Attribute key to use for sorting.
- $direction
- <p>Sort direction:
0 - ascending
1 - descending</p>
Returns
array Sorted ids.
Overrides
|
public
array
|
#
getAttributeValues( string $attribute_name = null, string $attribute_key = null, string $parent = DATATREE_ROOT, boolean $allLevels = true )
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.
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.
Parameters
- $attribute_name
- The name of the attribute.
- $attribute_key
- The key value of the attribute.
- $parent
- The parent node to start searching from.
- $allLevels
- <p>Return all levels, or just the direct
children of $parent?</p>
Returns
array An array of all of the available values.
|
public
TODO
|
#
updateData( string $object )
Update the data in an object. Does not change the object's
parent or name, just serialized data.
Update the data in an object. Does not change the object's
parent or name, just serialized data.
Parameters
Returns
TODO
Overrides
|
public
boolean
|
#
_init( )
Init the object.
Returns
boolean True.
|