39 $ENTITY_CACHE_DISABLED_GUIDS[
$guid] =
true;
52 unset($ENTITY_CACHE_DISABLED_GUIDS[
$guid]);
68 if (isset($ENTITY_CACHE[
$guid])) {
69 unset($ENTITY_CACHE[$guid]);
102 if (isset($ENTITY_CACHE_DISABLED_GUIDS[
$guid])) {
108 if (count($ENTITY_CACHE) > 256) {
128 if (isset($ENTITY_CACHE[
$guid])) {
129 if ($ENTITY_CACHE[$guid]->isFullyLoaded()) {
130 return $ENTITY_CACHE[
$guid];
225 return _elgg_services()->subtypeTable->getClassFromId($subtype_id);
328 'container_permissions_check',
554 $time_created_lower = null, $time_updated_upper = null, $time_updated_lower = null) {
556 $time_created_upper, $time_created_lower, $time_updated_upper, $time_updated_lower);
587 $viewer =
'elgg_view_entity_list') {
597 'full_view' =>
false,
598 'list_type_toggle' =>
false,
599 'pagination' =>
true,
606 if (isset(
$options[
'view_type_toggle'])) {
607 elgg_deprecated_notice(
"Option 'view_type_toggle' deprecated by 'list_type_toggle' in elgg_list* functions", 1.9);
616 $entities = call_user_func($getter,
$options);
623 return call_user_func($viewer, $entities,
$options);
692 $order_by =
'time_created') {
715 if (!in_array(
$type, $CONFIG->entity_types)) {
719 if (!isset($CONFIG->registered_entities)) {
720 $CONFIG->registered_entities = array();
723 if (!isset($CONFIG->registered_entities[
$type])) {
724 $CONFIG->registered_entities[
$type] = array();
750 if (!in_array(
$type, $CONFIG->entity_types)) {
754 if (!isset($CONFIG->registered_entities)) {
758 if (!isset($CONFIG->registered_entities[
$type])) {
763 if (in_array(
$subtype, $CONFIG->registered_entities[
$type])) {
765 unset($CONFIG->registered_entities[
$type][
$key]);
770 unset($CONFIG->registered_entities[
$type]);
787 if (!isset($CONFIG->registered_entities)) {
793 if (!empty(
$type) && empty($CONFIG->registered_entities[
$type])) {
798 return $CONFIG->registered_entities;
801 return $CONFIG->registered_entities[
$type];
815 if (!isset($CONFIG->registered_entities)) {
823 if (!isset($CONFIG->registered_entities[
$type])) {
856 'full_view' =>
false,
857 'allowed_types' =>
true,
858 'list_type_toggle' =>
false,
859 'pagination' =>
true,
862 'type_subtype_pairs' => array(),
868 if (isset(
$options[
'view_type_toggle'])) {
869 elgg_deprecated_notice(
"Option 'view_type_toggle' deprecated by 'list_type_toggle' in elgg_list* functions", 1.9);
875 foreach ($types as
$type => $subtype_array) {
878 if (
$type ==
'object') {
879 if (is_array($subtype_array) && count($subtype_array)) {
883 if (is_array($subtype_array) && count($subtype_array)) {
892 if (!empty(
$options[
'type_subtype_pairs'])) {
969 $value[] = $CONFIG->path .
'engine/tests/ElggEntityTest.php';
970 $value[] = $CONFIG->path .
'engine/tests/ElggCoreAttributeLoaderTest.php';
971 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesTest.php';
972 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromAnnotationsTest.php';
973 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromMetadataTest.php';
974 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromPrivateSettingsTest.php';
975 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromRelationshipTest.php';
976 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromAttributesTest.php';
977 $value[] = $CONFIG->path .
'engine/tests/ElggEntityPreloaderIntegrationTest.php';
993 $events->registerHandler(
'init',
'system',
'_elgg_entities_init');
_elgg_disable_caching_for_entity($guid)
Remove this entity from the entity cache and make sure it is not re-added.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
_elgg_populate_subtype_cache()
Fetch all suptypes from DB to local cache.
_elgg_retrieve_cached_subtype($type, $subtype)
Retrieve subtype from the cache.
_elgg_invalidate_cache_for_entity($guid)
Invalidate this class's entry in the cache.
elgg_get_entities_from_attributes(array $options=array())
Gets entities based upon attributes in secondary tables.
_elgg_retrieve_cached_entity($guid)
Retrieve a entity from the cache.
get_subtype_id($type, $subtype)
Return the id for a given subtype.
elgg_enable_entity($guid, $recursive=true)
Enable an entity.
_elgg_get_guid_based_where_sql($column, $guids)
Returns SQL where clause for owner and containers.
update_entity_last_action($guid, $posted=null)
Update the last_action column in the entities table for $guid.
_elgg_get_entity_time_where_sql($table, $time_created_upper=null, $time_created_lower=null, $time_updated_upper=null, $time_updated_lower=null)
Returns SQL where clause for entity time limits.
get_subtype_from_id($subtype_id)
Gets the denormalized string for a given subtype ID.
_elgg_cache_entity(\ElggEntity $entity)
Cache an entity.
get_entity_dates($type= '', $subtype= '', $container_guid=0, $site_guid=0, $order_by= 'time_created')
Returns a list of months in which entities were updated or created.
elgg_unregister_entity_type($type, $subtype=null)
Unregisters an entity type and subtype as a public-facing type.
getGUID()
Returns the guid.
elgg_entity_exists($guid)
Does an entity exist?
$guid
Removes an admin notice.
_elgg_enable_caching_for_entity($guid)
Allow this entity to be stored in the entity cache.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
if(isset($vars['id'])) $class
get_subtype_class_from_id($subtype_id)
Returns the class name for a subtype id.
elgg_get_ignore_access()
Get current ignore access setting.
entity_row_to_elggstar($row)
Create an Elgg* object from a given entity row.
get_subtype_class($type, $subtype)
Return the class name for a registered type and subtype.
is_registered_entity_type($type, $subtype=null)
Returns if the entity type and subtype have been registered with elgg_register_entity_type().
get_registered_entity_types($type=null)
Returns registered entity types and subtypes.
global $ENTITY_CACHE_DISABLED_GUIDS
GUIDs of entities banned from the entity cache (during this request)
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an and optionally for type and subtype.
add_subtype($type, $subtype, $class="")
Register with a certain type and subtype to be loaded as a specific class.
get_user($guid)
Get a user object from a GUID.
can_write_to_container($user_guid=0, $container_guid=0, $type= 'all', $subtype= 'all')
Determine if a given user can write to an entity container.
const ELGG_ENTITIES_ANY_VALUE
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
_elgg_entities_test($hook, $type, $value)
Runs unit tests for the entity objects.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
elgg global
Pointer to the global context.
get_entity_as_row($guid)
Returns a database row from the entities table.
update_subtype($type, $subtype, $class= '')
Update a registered type, subtype, and class name.
elgg_list_entities(array $options=array(), $getter= 'elgg_get_entities', $viewer= 'elgg_view_entity_list')
Returns a string of rendered entities.
elgg_list_registered_entities(array $options=array())
Returns a viewable list of entities based on the registered types.
remove_subtype($type, $subtype)
Removes a registered type, subtype, and classname.
_elgg_get_entity_type_subtype_where_sql($table, $types, $subtypes, $pairs)
Returns SQL where clause for type and subtype on main entity table.
_elgg_get_entity_attribute_where_sql(array $options=array())
Get the join and where clauses for working with entity attributes.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_register_entity_type($type, $subtype=null)
Registers an entity type and subtype as a public-facing entity that should be shown in search and by ...
$user_guid
Avatar remove action.
elgg_view_entity_list($entities, $vars=array(), $offset=0, $limit=null, $full_view=true, $list_type_toggle=true, $pagination=true)
Returns a rendered list of entities with pagination.
global $ENTITY_CACHE
Cache entities in memory once loaded.
_elgg_fetch_entities_from_sql($sql,\ElggBatch $batch=null)
Return entities from an SQL query generated by elgg_get_entities.
elgg_get_page_owner_guid($guid=0)
Gets the guid of the entity that owns the current page.
_elgg_entities_init()
Entities init function; establishes the default entity page handler.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
get_entity($guid)
Loads and returns an entity object from a guid.