engine/lib/entities.php File Reference

(r5432/r3468)

Go to the source code of this file.

Namespaces

namespace  Elgg

Classes

class  ElggEntity

Functions

 initialise_entity_cache ()
 Initialise the entity cache.
 invalidate_cache_for_entity ($guid)
 Invalidate this class' entry in the cache.
 cache_entity (ElggEntity $entity)
 Cache an entity.
 retrieve_cached_entity ($guid)
 Retrieve a entity from the cache.
 retrieve_cached_entity_row ($guid)
 As retrieve_cached_entity, but returns the result as a stdClass (compatible with load functions that expect a database row.
 get_subtype_id ($type, $subtype)
 Return the integer ID for a given subtype, or false.
 get_subtype_from_id ($subtype_id)
 For a given subtype ID, return its identifier text.
 get_subtype_class ($type, $subtype)
 This function tests to see if a subtype has a registered class handler.
 get_subtype_class_from_id ($subtype_id)
 This function tests to see if a subtype has a registered class handler by its id.
 add_subtype ($type, $subtype, $class="")
 This function will register a new subtype, returning its ID as required.
 update_entity ($guid, $owner_guid, $access_id, $container_guid=null)
 Update an existing entity.
 can_write_to_container ($user_guid=0, $container_guid=0, $entity_type= 'all')
 Determine whether a given user is able to write to a given container.
 create_entity ($type, $subtype, $owner_guid, $access_id, $site_guid=0, $container_guid=0)
 Create a new entity of a given type.
 get_entity_as_row ($guid)
 Retrieve the entity details for a specific GUID, returning it as a stdClass db row.
 entity_row_to_elggstar ($row)
 Create an Elgg* object from a given entity row.
 get_entity ($guid)
 Return the entity for a given guid as the correct object.
 get_entities ($type="", $subtype="", $owner_guid=0, $order_by="", $limit=10, $offset=0, $count=false, $site_guid=0, $container_guid=null, $timelower=0, $timeupper=0)
 Return entities matching a given query, or the number thereof.
 list_entities ($type="", $subtype="", $owner_guid=0, $limit=10, $fullview=true, $viewtypetoggle=false, $pagination=true)
 Returns a viewable list of entities.
 list_entities_groups ($subtype="", $owner_guid=0, $container_guid=0, $limit=10, $fullview=true)
 Returns a viewable list of entities contained in a number of groups.
 get_entity_dates ($type= '', $subtype= '', $container_guid=0, $site_guid=0)
 Returns a list of months containing content specified by the parameters.
 disable_entity ($guid, $reason="", $recursive=true)
 Disable an entity but not delete it.
 enable_entity ($guid)
 Enable an entity again.
 delete_entity ($guid, $recursive=true)
 Delete a given entity.
 delete_entities ($type="", $subtype="", $owner_guid=0)
 Delete multiple entities that match a given query.
 volatile_data_export_plugin_hook ($hook, $entity_type, $returnvalue, $params)
 A plugin hook to get certain volitile (generated on the fly) attributes about an entity in order to export them.
 export_entity_plugin_hook ($hook, $entity_type, $returnvalue, $params)
 Handler called by trigger_plugin_hook on the "export" event.
 oddentity_to_elggentity (ODDEntity $element)
 Utility function used by import_entity_plugin_hook() to process an ODDEntity into an unsaved ElggEntity.
 import_entity_plugin_hook ($hook, $entity_type, $returnvalue, $params)
 Import an entity.
 can_edit_entity ($entity_guid, $user_guid=0)
 Determines whether or not the specified user can edit the specified entity.
 can_edit_entity_metadata ($entity_guid, $user_guid=0, $metadata=null)
 Determines whether or not the specified user can edit metadata on the specified entity.
 get_entity_icon_url (ElggEntity $entity, $size= 'medium')
 Get the icon for an entity.
 get_entity_url ($entity_guid)
 Gets the URL for an entity, given a particular GUID.
 register_entity_url_handler ($function_name, $entity_type="all", $entity_subtype="all")
 Sets the URL handler for a particular entity type and subtype.
 default_entity_icon_hook ($hook, $entity_type, $returnvalue, $params)
 Default Icon URL handler for entities.
 register_entity_type ($type, $subtype)
 Registers and entity type and subtype to return in search and other places.
 get_registered_entity_types ($type= '')
 Returns registered entity types and subtypes.
 is_registered_entity_type ($type, $subtype)
 Determines whether or not the specified entity type and subtype have been registered in the system.
 entities_page_handler ($page)
 Page handler for generic entities view system.
 list_registered_entities ($owner_guid=0, $limit=10, $fullview=true, $viewtypetoggle=false, $allowedtypes=true)
 Returns a viewable list of entities based on the registered types.
 get_entities_from_private_setting ($name="", $value="", $type="", $subtype="", $owner_guid=0, $order_by="", $limit=10, $offset=0, $count=false, $site_guid=0, $container_guid=null)
 Get entities based on their private data, in a similar way to metadata.
 get_entities_from_private_setting_multi (array $name, $type="", $subtype="", $owner_guid=0, $order_by="", $limit=10, $offset=0, $count=false, $site_guid=0, $container_guid=null)
 Get entities based on their private data by multiple keys, in a similar way to metadata.
 get_private_setting ($entity_guid, $name)
 Gets a private setting for an entity.
 get_all_private_settings ($entity_guid)
 Return an array of all private settings for a given.
 set_private_setting ($entity_guid, $name, $value)
 Sets a private setting for an entity.
 remove_private_setting ($entity_guid, $name)
 Deletes a private setting for an entity.
 remove_all_private_settings ($entity_guid)
 Deletes all private settings for an entity.
 recursive_delete_permissions_check ($hook, $entity_type, $returnvalue, $params)
 entities_gc ($hook, $user, $returnvalue, $tag)
 Garbage collect stub and fragments from any broken delete/create calls.
 entities_init ()
 Entities init function; establishes the page handler.

Variables

 $ENTITY_CACHE = NULL
 Cache objects in order to minimise database access.
 $SUBTYPE_CACHE = NULL
 Cache subtype searches.


Function Documentation

add_subtype ( type,
subtype,
class = "" 
)

This function will register a new subtype, returning its ID as required.

Parameters:
string $type The type you're subtyping
string $subtype The subtype label
string $class Optional class handler (if you don't want it handled by the generic elgg handler for the type)

Definition at line 1243 of file entities.php.

References $class, $CONFIG, $id, $subtype, $type, get_subtype_id(), insert_data(), and sanitise_string().

Referenced by create_entity(), filestore_run_once(), plugin_run_once(), and widget_run_once().

cache_entity ( ElggEntity entity  ) 

Cache an entity.

Parameters:
ElggEntity $entity Entity to cache

Definition at line 1067 of file entities.php.

References $ENTITY_CACHE.

Referenced by ElggEntity.load(), and ElggEntity.save().

can_edit_entity ( entity_guid,
user_guid = 0 
)

Determines whether or not the specified user can edit the specified entity.

This is extendible by registering a plugin hook taking in the parameters 'entity' and 'user', which are the entity and user entities respectively

See also:
register_plugin_hook
Parameters:
int $entity_guid The GUID of the entity
int $user_guid The GUID of the user
Returns:
true|false Whether the specified user can edit the specified entity.

Definition at line 2064 of file entities.php.

References $CONFIG, $entity, $entity_guid, $return, $user, $user_guid, get_entity(), get_loggedin_user(), and trigger_plugin_hook().

Referenced by can_edit_entity_metadata(), can_edit_extender(), and ElggEntity.canEdit().

can_edit_entity_metadata ( entity_guid,
user_guid = 0,
metadata = null 
)

Determines whether or not the specified user can edit metadata on the specified entity.

This is extendible by registering a plugin hook taking in the parameters 'entity' and 'user', which are the entity and user entities respectively

See also:
register_plugin_hook
Parameters:
int $entity_guid The GUID of the entity
int $user_guid The GUID of the user
ElggMetadata $metadata The metadata to specifically check (if any; default null)
Returns:
true|false Whether the specified user can edit the specified entity.

Definition at line 2108 of file entities.php.

References $entity, $entity_guid, $return, $user, $user_guid, can_edit_entity(), get_entity(), owner_guid, and trigger_plugin_hook().

Referenced by ElggEntity.canEditMetadata().

can_write_to_container ( user_guid = 0,
container_guid = 0,
entity_type = 'all' 
)

Determine whether a given user is able to write to a given container.

Parameters:
int $user_guid The user guid, or 0 for get_loggedin_userid()
int $container_guid The container, or 0 for the current page owner.

Definition at line 1313 of file entities.php.

References $CONFIG, $container, $container_guid, $user, $user_guid, get_entity(), get_loggedin_user(), page_owner(), and trigger_plugin_hook().

Referenced by blog_pagesetup(), bookmarks_pagesetup(), ElggEntity.canWriteToContainer(), create_entity(), file_submenus(), and pages_container_permission_check().

create_entity ( type,
subtype,
owner_guid,
access_id,
site_guid = 0,
container_guid = 0 
)

Create a new entity of a given type.

Parameters:
string $type The type of the entity (site, user, object).
string $subtype The subtype of the entity.
int $owner_guid The GUID of the object's owner.
int $access_id The access control group to create the entity with.
int $site_guid The site to add this entity to. Leave as 0 (default) for the current site.
Returns:
mixed The new entity's GUID, or false on failure

Definition at line 1360 of file entities.php.

References $access_id, $CONFIG, $container_guid, $owner_guid, $subtype, $time, $type, $user, add_subtype(), can_write_to_container(), elgg_echo(), get_loggedin_user(), insert_data(), and sanitise_string().

Referenced by ElggEntity.save().

default_entity_icon_hook ( hook,
entity_type,
returnvalue,
params 
)

Default Icon URL handler for entities.

This will attempt to find a default entity for the current view and return a url. This is registered at a low priority so that other handlers will pick it up first.

Parameters:
unknown_type $hook
unknown_type $entity_type
unknown_type $returnvalue
unknown_type $params

Definition at line 2258 of file entities.php.

References $CONFIG, $entity, $params, $size, $subtype, $type, $url, $viewtype, get_subtype_from_id(), and subtype.

delete_entities ( type = "",
subtype = "",
owner_guid = 0 
)

Delete multiple entities that match a given query.

This function itterates through and calls delete_entity on each one, this is somewhat inefficient but lets the 'delete' even be called for each entity.

Parameters:
string $type The type of entity (eg "user", "object" etc)
string $subtype The arbitrary subtype of the entity
int $owner_guid The GUID of the owning user

Definition at line 1887 of file entities.php.

References $entities, $entity, $owner_guid, $subtype, $type, delete_entity(), and get_entities().

delete_entity ( guid,
recursive = true 
)

Delete a given entity.

Parameters:
int $guid
bool $recursive If true (default) then all entities which are owned or contained by $guid will also be deleted. Note: this bypasses ownership of sub items.

Definition at line 1820 of file entities.php.

References $CONFIG, $e, $entity, $guid, delete_data(), get_data(), get_entity(), get_loggedin_userid(), remove_all_private_settings(), remove_from_river_by_object(), remove_from_river_by_subject(), and trigger_elgg_event().

Referenced by clear_admin_message(), ElggEntity.delete(), and delete_entities().

disable_entity ( guid,
reason = "",
recursive = true 
)

Disable an entity but not delete it.

Parameters:
int $guid The guid
string $reason Optional reason

Definition at line 1742 of file entities.php.

References $CONFIG, $e, $entity, $guid, create_metadata(), get_data(), get_entity(), get_loggedin_userid(), sanitise_string(), trigger_elgg_event(), and update_data().

Referenced by ElggEntity.disable().

enable_entity ( guid  ) 

Enable an entity again.

Parameters:
int $guid

Definition at line 1785 of file entities.php.

References $access_status, $CONFIG, $entity, $guid, $result, access_get_show_hidden_status(), access_show_hidden_entities(), get_entity(), trigger_elgg_event(), and update_data().

Referenced by ElggEntity.enable().

entities_gc ( hook,
user,
returnvalue,
tag 
)

Garbage collect stub and fragments from any broken delete/create calls.

Parameters:
unknown_type $hook
unknown_type $user
unknown_type $returnvalue
unknown_type $tag

Definition at line 2758 of file entities.php.

References $CONFIG, and delete_data().

entities_init (  ) 

Entities init function; establishes the page handler.

Definition at line 2772 of file entities.php.

References register_page_handler(), and register_plugin_hook().

entities_page_handler ( page  ) 

Page handler for generic entities view system.

Parameters:
array $page Page elements from pain page handler

Definition at line 2352 of file entities.php.

References $CONFIG, $page, and set_input().

entity_row_to_elggstar ( row  ) 

Create an Elgg* object from a given entity row.

Definition at line 1423 of file entities.php.

References elgg_echo(), get_subtype_class_from_id(), is_memcache_available(), and subtype.

Referenced by get_entity().

export_entity_plugin_hook ( hook,
entity_type,
returnvalue,
params 
)

Handler called by trigger_plugin_hook on the "export" event.

Definition at line 1939 of file entities.php.

References $e, $entity, $export, $guid, $params, elgg_echo(), and get_entity().

get_all_private_settings ( entity_guid  ) 

Return an array of all private settings for a given.

Parameters:
int $entity_guid The entity GUID

Definition at line 2669 of file entities.php.

References $CONFIG, $entity_guid, $r, $result, $return, and get_data().

Referenced by find_plugin_usersettings().

get_entities ( type = "",
subtype = "",
owner_guid = 0,
order_by = "",
limit = 10,
offset = 0,
count = false,
site_guid = 0,
container_guid = null,
timelower = 0,
timeupper = 0 
)

Return entities matching a given query, or the number thereof.

Parameters:
string $type The type of entity (eg "user", "object" etc)
string|array $subtype The arbitrary subtype of the entity or array(type1 => array('subtype1', ...'subtypeN'), ...)
int $owner_guid The GUID of the owning user
string $order_by The field to order by; by default, time_created desc
int $limit The number of entities to return; 10 by default
int $offset The indexing offset, 0 by default
boolean $count Set to true to get a count rather than the entities themselves (limits and offsets don't apply in this context). Defaults to false.
int $site_guid The site to get entities for. Leave as 0 (default) for the current site; -1 for all sites.
int|array $container_guid The container or containers to get entities from (default: all containers).
int $timelower The earliest time the entity can have been created. Default: all
int $timeupper The latest time the entity can have been created. Default: all
Returns:
array A list of entities.

Definition at line 1509 of file entities.php.

References $CONFIG, $container_guid, $count, $limit, $offset, $owner_guid, $subtype, $timelower, $timeupper, $type, $val, get_access_sql_suffix(), get_data(), get_data_row(), get_subtype_id(), and sanitise_string().

Referenced by count_user_friends_objects(), count_user_objects(), defaultwidgets_newusers(), defaultwidgets_reset_access(), delete_entities(), find_plugin_settings(), get_user_friends_objects(), get_user_objects(), list_entities(), and list_registered_entities().

get_entities_from_private_setting ( name = "",
value = "",
type = "",
subtype = "",
owner_guid = 0,
order_by = "",
limit = 10,
offset = 0,
count = false,
site_guid = 0,
container_guid = null 
)

Get entities based on their private data, in a similar way to metadata.

Parameters:
string $name The name of the setting
string $value The value of the setting
string $type The type of entity (eg "user", "object" etc)
string $subtype The arbitrary subtype of the entity
int $owner_guid The GUID of the owning user
string $order_by The field to order by; by default, time_created desc
int $limit The number of entities to return; 10 by default
int $offset The indexing offset, 0 by default
boolean $count Set to true to get a count rather than the entities themselves (limits and offsets don't apply in this context). Defaults to false.
int $site_guid The site to get entities for. Leave as 0 (default) for the current site; -1 for all sites.
int|array $container_guid The container or containers to get entities from (default: all containers).
Returns:
array A list of entities.

Definition at line 2410 of file entities.php.

References $CONFIG, $container_guid, $count, $limit, $name, $offset, $owner_guid, $subtype, $type, $val, get_access_sql_suffix(), get_data(), get_data_row(), get_subtype_id(), and sanitise_string().

get_entities_from_private_setting_multi ( array $  name,
type = "",
subtype = "",
owner_guid = 0,
order_by = "",
limit = 10,
offset = 0,
count = false,
site_guid = 0,
container_guid = null 
)

Get entities based on their private data by multiple keys, in a similar way to metadata.

Parameters:
string $name The name of the setting
string $value The value of the setting
string|array $type The type of entity (eg "user", "object" etc) or array(type1 => array('subtype1', ...'subtypeN'), ...)
string $subtype The arbitrary subtype of the entity
int $owner_guid The GUID of the owning user
string $order_by The field to order by; by default, time_created desc
int $limit The number of entities to return; 10 by default
int $offset The indexing offset, 0 by default
boolean $count Set to true to get a count rather than the entities themselves (limits and offsets don't apply in this context). Defaults to false.
int $site_guid The site to get entities for. Leave as 0 (default) for the current site; -1 for all sites.
int|array $container_guid The container or containers to get entities from (default: all containers).
Returns:
array A list of entities.

Definition at line 2533 of file entities.php.

References $CONFIG, $container_guid, $count, $i, $limit, $n, $offset, $owner_guid, $subtype, $type, $val, get_access_sql_suffix(), get_data(), get_data_row(), get_subtype_id(), and sanitise_string().

Referenced by get_widgets().

get_entity ( guid  ) 

Return the entity for a given guid as the correct object.

Parameters:
int $guid The GUID of the entity
Returns:
a child of ElggEntity appropriate for the type.

Definition at line 1481 of file entities.php.

References $guid, entity_row_to_elggstar(), get_entity_as_row(), and is_memcache_available().

Referenced by add_object_to_group(), add_to_river(), ElggGroup.addFriend(), ban_user(), can_edit_entity(), can_edit_entity_metadata(), can_edit_extender(), can_write_to_container(), ElggMetadata.canEdit(), check_rate_limit_exceeded(), clear_annotations(), clear_metadata(), create_annotation(), create_group_entity(), create_object_entity(), create_site_entity(), create_user_entity(), defaultwidgets_newusers(), delete_entity(), disable_entity(), disable_plugin(), disable_user_entities(), elgg_view(), elgg_view_river_item(), email_notify_handler(), enable_entity(), enable_plugin(), execute_new_password_request(), export_entity_plugin_hook(), file_add_to_folders(), file_delete(), file_display_thumbnail(), file_handle_save(), file_manage_download(), file_manage_icon_download(), file_set_page_owner(), force_user_password_reset(), get_entity_url(), get_plugin_list(), get_plugin_usersetting(), get_site_domain(), get_user(), ElggObject.getContainerEntity(), ElggExtender.getEntity(), ElggEntity.getObjectFromID(), ElggEntity.getOwnerEntity(), ElggDiskFilestore.getSize(), group_topicpost_url(), groupforumtopic_notify_message(), groups_page_owner_handler(), is_plugin_enabled(), join_group(), leave_group(), log_login_failure(), notify_user(), page_owner(), page_owner_entity(), pages_container_permission_check(), pages_get_path(), pages_page_handler(), pages_set_navigation_parent(), pam_auth_usertoken(), regenerate_plugin_list(), relationship_notification_hook(), remove_object_from_group(), ElggGroup.removeFriend(), request_user_validation(), reset_login_failure_count(), save_widget_info(), send_new_password_request(), set_plugin_usersetting(), set_user_notification_setting(), sites_init(), unban_user(), update_entity(), user_add_friend(), uservalidationbyemail_request_validation(), uservalidationbyemail_validate_email(), and volatile_data_export_plugin_hook().

get_entity_as_row ( guid  ) 

Retrieve the entity details for a specific GUID, returning it as a stdClass db row.

You will only get an object if a) it exists, b) you have access to it.

Parameters:
int $guid The GUID of the object to extract

Definition at line 1391 of file entities.php.

References $access, $CONFIG, $guid, get_access_sql_suffix(), and get_data_row().

Referenced by create_group_entity(), create_object_entity(), create_site_entity(), create_user_entity(), get_entity(), and ElggEntity.load().

get_entity_dates ( type = '',
subtype = '',
container_guid = 0,
site_guid = 0 
)

Returns a list of months containing content specified by the parameters.

Parameters:
string $type The type of entity
string $subtype The subtype of entity
int $container_guid The container GUID that the entinties belong to
int $site_guid The site GUID
Returns:
array|false Either an array of timestamps, or false on failure

Definition at line 1665 of file entities.php.

References $CONFIG, $container_guid, $result, $subtype, $type, $val, get_access_sql_suffix(), get_data(), get_subtype_id(), and sanitise_string().

Referenced by blog_pagesetup().

get_entity_icon_url ( ElggEntity entity,
size = 'medium' 
)

Get the icon for an entity.

Parameters:
ElggEntity $entity The entity (passed an entity rather than a guid to handle non-created entities)
string $size

Definition at line 2135 of file entities.php.

References $CONFIG, $size, $subtype, $type, $url, $viewtype, elgg_get_viewtype(), elgg_view(), ElggEntity.getSubtype(), ElggEntity.getType(), sanitise_string(), and trigger_plugin_hook().

Referenced by ElggEntity.getIcon().

get_entity_url ( entity_guid  ) 

Gets the URL for an entity, given a particular GUID.

Parameters:
int $entity_guid The GUID of the entity
Returns:
string The URL of the entity

Definition at line 2189 of file entities.php.

References $CONFIG, $entity, $entity_guid, $url, and get_entity().

Referenced by ElggEntity.getURL().

get_private_setting ( entity_guid,
name 
)

Gets a private setting for an entity.

Parameters:
int $entity_guid The entity GUID
string $name The name of the setting
Returns:
mixed The setting value, or false on failure

Definition at line 2651 of file entities.php.

References $CONFIG, $entity_guid, $name, get_data_row(), and sanitise_string().

Referenced by execute_new_password_request(), ElggWidget.get(), ElggPlugin.get(), get_plugin_usersetting(), and ElggEntity.getPrivateSetting().

get_registered_entity_types ( type = ''  ) 

Returns registered entity types and subtypes.

See also:
register_entity_type
Parameters:
string $type The type of entity (object, site, user, group) or blank for all
Returns:
array|false Depending on whether entities have been registered

Definition at line 2314 of file entities.php.

References $CONFIG, and $type.

Referenced by list_registered_entities().

get_subtype_class ( type,
subtype 
)

This function tests to see if a subtype has a registered class handler.

Parameters:
string $type The type
string $subtype The subtype
Returns:
a class name or null

Definition at line 1184 of file entities.php.

References $CONFIG, $result, $subtype, $SUBTYPE_CACHE, $type, get_data_row(), and sanitise_string().

Referenced by oddentity_to_elggentity().

get_subtype_class_from_id ( subtype_id  ) 

This function tests to see if a subtype has a registered class handler by its id.

Parameters:
int $subtype_id The subtype
Returns:
a class name or null

Definition at line 1212 of file entities.php.

References $CONFIG, $result, $SUBTYPE_CACHE, and get_data_row().

Referenced by entity_row_to_elggstar().

get_subtype_from_id ( subtype_id  ) 

For a given subtype ID, return its identifier text.

TODO: Move to a nicer place?

Parameters:
int $subtype_id

Definition at line 1153 of file entities.php.

References $CONFIG, $result, $SUBTYPE_CACHE, get_data_row(), and subtype.

Referenced by default_entity_icon_hook(), ElggEntity.export(), ElggEntity.getSubtype(), and profile_usericon_hook().

get_subtype_id ( type,
subtype 
)

import_entity_plugin_hook ( hook,
entity_type,
returnvalue,
params 
)

Import an entity.

This function checks the passed XML doc (as array) to see if it is a user, if so it constructs a new elgg user and returns "true" to inform the importer that it's been handled.

Definition at line 2025 of file entities.php.

References $params, add_uuid_to_guid(), elgg_echo(), and oddentity_to_elggentity().

initialise_entity_cache (  ) 

Initialise the entity cache.

Definition at line 1039 of file entities.php.

References $ENTITY_CACHE.

Referenced by ElggEntity.initialise_attributes().

invalidate_cache_for_entity ( guid  ) 

Invalidate this class' entry in the cache.

Parameters:
int $guid The guid

Definition at line 1052 of file entities.php.

References $ENTITY_CACHE, and $guid.

is_registered_entity_type ( type,
subtype 
)

Determines whether or not the specified entity type and subtype have been registered in the system.

Parameters:
string $type The type of entity (object, site, user, group)
string $subtype The subtype (may be blank)
Returns:
true|false Depending on whether or not the type has been registered

Definition at line 2336 of file entities.php.

References $CONFIG, $subtype, and $type.

list_entities ( type = "",
subtype = "",
owner_guid = 0,
limit = 10,
fullview = true,
viewtypetoggle = false,
pagination = true 
)

Returns a viewable list of entities.

See also:
elgg_view_entity_list
Parameters:
string $type The type of entity (eg "user", "object" etc)
string $subtype The arbitrary subtype of the entity
int $owner_guid The GUID of the owning user
int $limit The number of entities to display per page (default: 10)
true|false $fullview Whether or not to display the full view (default: true)
true|false $viewtypetoggle Whether or not to allow gallery view
true|false $pagination Display pagination? Default: true
Returns:
string A viewable list of entities

Definition at line 1627 of file entities.php.

References $count, $entities, $fullview, $limit, $offset, $owner_guid, $pagination, $subtype, $type, elgg_view_entity_list(), get_entities(), and get_input().

Referenced by list_admin_messages().

list_entities_groups ( subtype = "",
owner_guid = 0,
container_guid = 0,
limit = 10,
fullview = true 
)

Returns a viewable list of entities contained in a number of groups.

Parameters:
string $subtype The arbitrary subtype of the entity
int $owner_guid The GUID of the owning user
int $container_guid The GUID of the containing group
int $limit The number of entities to display per page (default: 10)
true|false $fullview Whether or not to display the full view (default: true)
Returns:
string A viewable list of entities

Definition at line 1647 of file entities.php.

References $container_guid, $count, $entities, $fullview, $limit, $offset, $owner_guid, $subtype, elgg_view_entity_list(), get_input(), and get_objects_in_group().

list_registered_entities ( owner_guid = 0,
limit = 10,
fullview = true,
viewtypetoggle = false,
allowedtypes = true 
)

Returns a viewable list of entities based on the registered types.

See also:
elgg_view_entity_list
Parameters:
string $type The type of entity (eg "user", "object" etc)
string $subtype The arbitrary subtype of the entity
int $owner_guid The GUID of the owning user
int $limit The number of entities to display per page (default: 10)
true|false $fullview Whether or not to display the full view (default: true)
true|false $viewtypetoggle Whether or not to allow gallery view
Returns:
string A viewable list of entities

Definition at line 2373 of file entities.php.

References $count, $entities, $fullview, $limit, $offset, $owner_guid, elgg_view_entity_list(), get_entities(), get_input(), and get_registered_entity_types().

oddentity_to_elggentity ( ODDEntity element  ) 

Utility function used by import_entity_plugin_hook() to process an ODDEntity into an unsaved ElggEntity.

Parameters:
ODDEntity $element The OpenDD element
Returns:
ElggEntity the unsaved entity which should be populated by items.

Definition at line 1972 of file entities.php.

References $class, elgg_echo(), get_entity_from_uuid(), get_subtype_class(), and ODD.getAttribute().

Referenced by import_entity_plugin_hook().

recursive_delete_permissions_check ( hook,
entity_type,
returnvalue,
params 
)

Definition at line 2739 of file entities.php.

References $entity, $params, get_loggedin_userid(), and isloggedin().

register_entity_type ( type,
subtype 
)

Registers and entity type and subtype to return in search and other places.

A description in the elgg_echo languages file of the form item:type:subtype is also expected.

Parameters:
string $type The type of entity (object, site, user, group)
string $subtype The subtype to register (may be blank)
Returns:
true|false Depending on success

Definition at line 2292 of file entities.php.

References $CONFIG, $subtype, and $type.

Referenced by blog_init(), bookmarks_init(), file_init(), group_init(), pages_init(), thewire_init(), and users_init().

register_entity_url_handler ( function_name,
entity_type = "all",
entity_subtype = "all" 
)

Sets the URL handler for a particular entity type and subtype.

Parameters:
string $function_name The function to register
string $entity_type The entity type
string $entity_subtype The entity subtype
Returns:
true|false Depending on success

Definition at line 2231 of file entities.php.

References $CONFIG.

Referenced by blog_init(), bookmarks_init(), expages_init(), file_init(), groups_init(), messages_init(), pages_init(), profile_init(), and thewire_init().

remove_all_private_settings ( entity_guid  ) 

Deletes all private settings for an entity.

Parameters:
int $entity_guid The Entity GUID
Returns:
true|false depending on success

Definition at line 2732 of file entities.php.

References $CONFIG, $entity_guid, and delete_data().

Referenced by clear_plugin_setting(), and delete_entity().

remove_private_setting ( entity_guid,
name 
)

Deletes a private setting for an entity.

Parameters:
int $entity_guid The Entity GUID
string $name The name of the setting
Returns:
true|false depending on success

Definition at line 2716 of file entities.php.

References $CONFIG, $entity_guid, $name, delete_data(), and sanitise_string().

Referenced by execute_new_password_request(), and ElggEntity.removePrivateSetting().

retrieve_cached_entity ( guid  ) 

Retrieve a entity from the cache.

Parameters:
int $guid The guid

Definition at line 1079 of file entities.php.

References $ENTITY_CACHE, and $guid.

Referenced by get_user_by_code(), get_user_by_username(), and retrieve_cached_entity_row().

retrieve_cached_entity_row ( guid  ) 

As retrieve_cached_entity, but returns the result as a stdClass (compatible with load functions that expect a database row.

)

Parameters:
int $guid The guid

Definition at line 1097 of file entities.php.

References $guid, $obj, and retrieve_cached_entity().

set_private_setting ( entity_guid,
name,
value 
)

Sets a private setting for an entity.

Parameters:
int $entity_guid The entity GUID
string $name The name of the setting
string $value The value of the setting
Returns:
mixed The setting ID, or false on failure

Definition at line 2695 of file entities.php.

References $CONFIG, $entity_guid, $name, $result, insert_data(), and sanitise_string().

Referenced by send_new_password_request(), ElggWidget.set(), ElggPlugin.set(), set_plugin_usersetting(), and ElggEntity.setPrivateSetting().

update_entity ( guid,
owner_guid,
access_id,
container_guid = null 
)

Update an existing entity.

Parameters:
int $guid
int $owner_guid
int $access_id
int $container_guid

Definition at line 1270 of file entities.php.

References $access_id, $CONFIG, $container_guid, $entity, $ENTITY_CACHE, $guid, $owner_guid, $time, get_entity(), is_memcache_available(), trigger_elgg_event(), update_data(), and update_river_access_by_object().

Referenced by ElggEntity.save().

volatile_data_export_plugin_hook ( hook,
entity_type,
returnvalue,
params 
)

A plugin hook to get certain volitile (generated on the fly) attributes about an entity in order to export them.

Parameters:
unknown_type $hook
unknown_type $entity_type
unknown_type $returnvalue
unknown_type $params The parameters, passed 'guid' and 'varname'
Returns:
unknown

Definition at line 1906 of file entities.php.

References $guid, $params, elgg_set_viewtype(), elgg_view_entity(), get_entity(), and sanitise_string().


Variable Documentation

$ENTITY_CACHE = NULL

Cache objects in order to minimise database access.

Definition at line 15 of file entities.php.

Referenced by cache_entity(), initialise_entity_cache(), invalidate_cache_for_entity(), retrieve_cached_entity(), and update_entity().

$SUBTYPE_CACHE = NULL

Cache subtype searches.

Definition at line 18 of file entities.php.

Referenced by get_subtype_class(), get_subtype_class_from_id(), get_subtype_from_id(), and get_subtype_id().


Generated on Thu Mar 18 00:02:37 2010 for Elgg by  doxygen 1.5.6