PHP Class Content_Objects_Manager, horde

Author: Chuck Hagenbuch ([email protected])
Author: Michael Rubinsky ([email protected])
Mostrar archivo Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_db Horde_Db_Adapter Database adapter
$_tables array Tables
$_typeManager Content_Types_Manager Type manager

Public Methods

Method Description
__construct ( Horde_Db_Adapter $db, Content_Types_Manager $typeManager ) : Content_Objects_Manager Constructor
delete ( )
delete ( array $objects, string $type ) Remove the object.
ensureObjects ( mixed $objects, mixed $type ) : array 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 ( $objects, mixed $type ) : mixed Check for object existence without causing the objects to be created.

Protected Methods

Method Description
_t ( string $tableType ) : string Shortcut for getting a table name.

Method Details

__construct() public method

Constructor
public __construct ( Horde_Db_Adapter $db, Content_Types_Manager $typeManager ) : Content_Objects_Manager
$db Horde_Db_Adapter The db adapter
$typeManager Content_Types_Manager A content type manager
return Content_Objects_Manager

_t() protected method

Shortcut for getting a table name.
protected _t ( string $tableType ) : string
$tableType string
return string Configured table name.

delete() public method

public delete ( )

delete() public method

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.
public delete ( array $objects, string $type )
$objects array An array of object identifiers to delete.
$type string The type of the objects. All objects must be of the same type.

ensureObjects() public method

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
$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 array An array of object_ids.

exists() public method

Helps save queries for things like tags when we already know the object doesn't yet exist in rampage tables.
public exists ( $objects, mixed $type ) : mixed
$type mixed A type identifier. Either a string type name or the integer type_id.
return mixed Either a hash of object_id => object_names or false if the object(s) do not exist.

Property Details

$_db protected_oe property

Database adapter
protected Horde_Db_Adapter $_db
return Horde_Db_Adapter

$_tables protected_oe property

Tables
protected array $_tables
return array

$_typeManager protected_oe property

Type manager
protected Content_Types_Manager $_typeManager
return Content_Types_Manager