Documentation

Content_Objects_Manager
in package

Tags
author

Chuck Hagenbuch chuck@horde.org

author

Michael Rubinsky mrubinsk@horde.org

license

http://www.horde.org/licenses/bsd BSD

category

Horde

Table of Contents

$_db  : Horde_Db_Adapter
Database adapter
$_tables  : array<string|int, mixed>
Tables
$_typeManager  : Content_Types_Manager
Type manager
__construct()  : Content_Objects_Manager
Constructor
delete()  : mixed
Remove the object.
ensureObjects()  : array<string|int, mixed>
Ensure that an array of objects exist in storage. Create any that don't, return object_ids for all. All objects in the $objects array must be of the same content type.
exists()  : mixed
Check for object existence without causing the objects to be created.
_t()  : string
Shortcut for getting a table name.

Properties

$_db

Database adapter

protected Horde_Db_Adapter $_db

$_tables

Tables

protected array<string|int, mixed> $_tables = array('objects' => 'rampage_objects')
Tags
TODO:

this should probably be populated by the responsible manager...

Methods

delete()

Remove the object.

public delete(array<string|int, mixed> $objects, string $type) : mixed

NOTE: This does not ensure any references to this object were removed. E.g., does not remove any tags etc... That is client code's responsibility.

Parameters
$objects : array<string|int, mixed>

An array of object identifiers to delete.

$type : string

The type of the objects. All objects must be of the same type.

Tags
throws
Content_Exception
Return values
mixed

ensureObjects()

Ensure that an array of objects exist in storage. Create any that don't, return object_ids for all. All objects in the $objects array must be of the same content type.

public ensureObjects(mixed $objects, mixed $type) : array<string|int, mixed>
Parameters
$objects : mixed

An array of objects (or single obejct value). Values typed as an integer are assumed to already be an object_id.

$type : mixed

Either a string type_name or integer type_id

Return values
array<string|int, mixed>

An array of object_ids.

exists()

Check for object existence without causing the objects to be created.

public exists(mixed $objects, mixed $type) : mixed

Helps save queries for things like tags when we already know the object doesn't yet exist in rampage tables.

Parameters
$objects : mixed
$type : mixed

A type identifier. Either a string type name or the integer type_id.

Tags
throws

InvalidArgumentException, Content_Exception

Return values
mixed

Either a hash of object_id => object_names or false if the object(s) do not exist.

_t()

Shortcut for getting a table name.

protected _t(string $tableType) : string
Parameters
$tableType : string
Return values
string

Configured table name.

Search results