Property | Type | Description | |
---|---|---|---|
$_db | Horde_Db_Adapter | Database connection | |
$_defaultRadius | integer | Default radius for relationship queries. | |
$_objectManager | Content_Objects_Manager | Object manager | |
$_tables | array | Tables | |
$_typeManager | Content_Types_Manager | Type management object | |
$_userManager | Content_Users_Manager | User manager object |
Method | Description | |
---|---|---|
__construct ( Horde_Db_Adapter $db, Content_Users_Manager $userManager, Content_Types_Manager $typeManager, Content_Objects_Manager $objectManager ) | Constructor | |
browseTags ( array $ids, $object_type, string $user ) : array | Retrieve a set of tags with relationships to the specified set of tags. | |
ensureTags ( array $tags ) : array | Ensure that an array of tags exist, create any that don't, and return ids for all of them. | |
getObjects ( array $args ) : array | Get objects matching search criteria. | |
getRecentObjects ( array $args = [] ) : array | Get the most recently tagged objects. | |
getRecentTags ( array $args = [] ) : array | Get the most recently used tags. | |
getRecentUsers ( array $args = [] ) : array | Get the users who have most recently tagged objects. | |
getSimilarObjects ( mixed $object_id, array $args = [] ) : array | Return objects related to the given object via tags, along with a similarity rank. | |
getSimilarUsers ( $args ) | Return users related to a given user along with a similarity rank. | |
getTagCloud ( array $args = [] ) : array | Generate a tag cloud. Same syntax as getTags, except that fetching a cloud for a userId + objectId combination doesn't make sense - the counts would all be one. In addition, this method returns counts for each tag. | |
getTagIds ( $tags ) | ||
getTags ( array $args ) : array | Retrieve tags based on criteria. | |
getTagsByObjects ( $objects, mixed $type ) : array | Obtain all the tags for a given set of objects. | |
getUsers ( $args ) | Find users through objects, tags, or other users. | |
removeTagFromObject ( $objectId, mixed $tags ) : void | Remove all occurrences of a specific tag from an object regardless of the username who tagged the object originally. | |
splitTags ( string $text ) : array | Split a string into an array of tag names, respecting tags with spaces and ones that are quoted in some way. For example: this, "somecompany, llc", "and ""this"" w,o.rks", foo bar | |
tag ( mixed $userId, mixed $objectId, array $tags, Horde_Date $created = null ) : void | Adds a tag or several tags to an object_id. This method does not remove other tags. | |
toDriver ( $value ) | ||
untag ( mixed $userId, mixed $objectId, array $tags ) | Undo a user's tagging of an object. |
Method | Description | |
---|---|---|
_checkTags ( string | array $tags, boolean $create = true ) : array | Check if tags exists, optionally create them if they don't and return ids for all that exist (including those that are optionally created). | |
_ensureObject ( $object ) | Convenience method - if $object is an array, it is taken as an array of 'object' and 'type' to pass to objectManager::ensureObjects() if it's a scalar value, it's taken as the object_id and simply returned. | |
_t ( string $tableType ) : string | Shortcut for getting a table name. |
public __construct ( Horde_Db_Adapter $db, Content_Users_Manager $userManager, Content_Types_Manager $typeManager, Content_Objects_Manager $objectManager ) | ||
$db | Horde_Db_Adapter | |
$userManager | Content_Users_Manager | |
$typeManager | Content_Types_Manager | |
$objectManager | Content_Objects_Manager |
protected _ensureObject ( $object ) |
public ensureTags ( array $tags ) : array | ||
$tags | array | Array of tag names or ids. |
return | array | Hash of tag_name => tag_id values. |
public getObjects ( array $args ) : array | ||
$args | array | Search criteria: limit Maximum number of objects to return. offset Offset the results. Only useful for paginating, and not recommended. tagId Return objects related through one or more tags. notTagId Don't return objects tagged with one or more tags. typeId Only return objects with a specific type. objectId Return objects with the same tags as $objectId. userId Limit results to objects tagged by a specific user. radius Radius setting for relationship queries e.g., objectId |
return | array | An array of object ids. |
public getRecentObjects ( array $args = [] ) : array | ||
$args | array | Search criteria: limit Maximum number of objects to return. offset Offset the results. Only useful for paginating, and not recommended. userId Only return objects that have been tagged by a specific user. typeId Only return objects of a specific object type. |
return | array |
public getRecentTags ( array $args = [] ) : array | ||
$args | array | Search criteria: limit Maximum number of tags to return. offset Offset the results. Only useful for paginating, and not recommended. userId Only return tags that have been used by a specific user. typeId Only return tags applied to objects of a specific type. |
return | array |
public getRecentUsers ( array $args = [] ) : array | ||
$args | array | Search criteria: limit Maximum number of users to return. offset Offset the results. Only useful for paginating, and not recommended. typeId Only return users who have tagged objects of a specific object type. |
return | array |
public getSimilarObjects ( mixed $object_id, array $args = [] ) : array | ||
$object_id | mixed | The object to find relations for. |
$args | array | limit Maximum number of objects to return (default 10). userId Only return objects that have been tagged by a specific user. typeId Only return objects of a specific type. threshold Number of tags-in-common objects must have to match (default 1). |
return | array | An array of (client) object ids => similarity rank |
public getSimilarUsers ( $args ) |
public getTagCloud ( array $args = [] ) : array | ||
$args | array | Search criteria: - limit: (integer) Maximum number of tags to return. - offset: (integet) Offset the results. Only useful for paginating, and not recommended. - userId: (string) Only return tags that have been applied by a specific user. - typeId: (array) Only return tags that have been applied by specific object types. - objectId: (array) Only return tags that have been applied to specific objects all objects must be of the same type and specified by typeId. - tagIds: (array) Only return information on specific tag (an array of tag ids). |
return | array | An array of hashes, each containing tag_id, tag_name, and count. |
public getTags ( array $args ) : array | ||
$args | array | Search criteria: q Starts-with search on tag_name. limit Maximum number of tags to return. offset Offset the results. Only useful for paginating, and not recommended. userId Only return tags that have been applied by a specific user. typeId Only return tags that have been applied by a specific object type. objectId Only return tags that have been applied to a specific object. |
return | array | An array of tags, id => name. |
public getTagsByObjects ( $objects, mixed $type ) : array | ||
$type | mixed | Either a string type description, or an integer content type_id |
return | array | An array in the form of:
array('localobjectId' => array('tagone', 'tagtwo'), 'anotherobjectid' => array('anothertag', 'yetanother')) |
public getUsers ( $args ) |
public removeTagFromObject ( $objectId, mixed $tags ) : void | ||
$tags | mixed | The tags to remove. @see Content_Tagger::tag() |
return | void |
public tag ( mixed $userId, mixed $objectId, array $tags, Horde_Date $created = null ) : void | ||
$userId | mixed | The user tagging the object. |
$objectId | mixed | The object id to tag or an array containing the object_name and type. |
$tags | array | An array of tag name or ids. |
$created | Horde_Date | The datetime of the tagging operation. |
return | void |
protected Horde_Db_Adapter $_db | ||
return | Horde_Db_Adapter |
protected int $_defaultRadius | ||
return | integer |
protected Content_Objects_Manager $_objectManager | ||
return | Content_Objects_Manager |
protected Content_Types_Manager $_typeManager | ||
return | Content_Types_Manager |