72 return _elgg_services()->subtypeTable->getClassFromId($subtype_id);
360 $time_created_lower = null, $time_updated_upper = null, $time_updated_lower = null) {
362 $time_created_upper, $time_created_lower, $time_updated_upper, $time_updated_lower);
394 $viewer =
'elgg_view_entity_list') {
403 'full_view' =>
false,
404 'list_type_toggle' =>
false,
405 'pagination' =>
true,
412 if (isset(
$options[
'view_type_toggle'])) {
413 elgg_deprecated_notice(
"Option 'view_type_toggle' deprecated by 'list_type_toggle' in elgg_list* functions", 1.9);
418 $entities = call_user_func($getter,
$options);
419 $options[
'count'] = is_array($entities) ? count($entities) : 0;
421 if (!empty($entities)) {
422 $count_needed =
true;
424 $count_needed =
false;
426 $count_needed =
false;
427 } elseif ((
$options[
'count'] < (
int)
$options[
'limit']) && !$options[
'offset']) {
428 $count_needed =
false;
432 $options[
'count'] =
true;
434 $options[
'count'] = (int) call_user_func($getter, $options);
438 return call_user_func($viewer, $entities,
$options);
507 $order_by =
'time_created') {
530 if (!in_array(
$type, $CONFIG->entity_types)) {
534 if (!isset($CONFIG->registered_entities)) {
535 $CONFIG->registered_entities = array();
538 if (!isset($CONFIG->registered_entities[
$type])) {
539 $CONFIG->registered_entities[
$type] = array();
565 if (!in_array(
$type, $CONFIG->entity_types)) {
569 if (!isset($CONFIG->registered_entities)) {
573 if (!isset($CONFIG->registered_entities[
$type])) {
578 if (in_array(
$subtype, $CONFIG->registered_entities[
$type])) {
580 unset($CONFIG->registered_entities[
$type][
$key]);
585 unset($CONFIG->registered_entities[
$type]);
602 if (!isset($CONFIG->registered_entities)) {
608 if (!empty(
$type) && empty($CONFIG->registered_entities[
$type])) {
613 return $CONFIG->registered_entities;
616 return $CONFIG->registered_entities[
$type];
630 if (!isset($CONFIG->registered_entities)) {
638 if (!isset($CONFIG->registered_entities[
$type])) {
670 'full_view' =>
false,
671 'allowed_types' =>
true,
672 'list_type_toggle' =>
false,
673 'pagination' =>
true,
676 'type_subtype_pairs' => array(),
682 if (isset(
$options[
'view_type_toggle'])) {
683 elgg_deprecated_notice(
"Option 'view_type_toggle' deprecated by 'list_type_toggle' in elgg_list* functions", 1.9);
689 foreach ($types as
$type => $subtype_array) {
692 if (
$type ==
'object') {
693 if (is_array($subtype_array) && count($subtype_array)) {
697 if (is_array($subtype_array) && count($subtype_array)) {
706 if (!empty(
$options[
'type_subtype_pairs'])) {
769 elgg_deprecated_notice(__FUNCTION__ .
' has been deprecated. Refrain from updating last action timestamp manually',
'2.3');
793 $value[] = $CONFIG->path .
'engine/tests/ElggEntityTest.php';
794 $value[] = $CONFIG->path .
'engine/tests/ElggCoreAttributeLoaderTest.php';
795 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesTest.php';
796 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromAnnotationsTest.php';
797 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromMetadataTest.php';
798 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromPrivateSettingsTest.php';
799 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromRelationshipTest.php';
800 $value[] = $CONFIG->path .
'engine/tests/ElggCoreGetEntitiesFromAttributesTest.php';
801 $value[] = $CONFIG->path .
'engine/tests/ElggEntityPreloaderIntegrationTest.php';
817 $events->registerHandler(
'init',
'system',
'_elgg_entities_init');
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_get_entities_from_attributes(array $options=array())
Gets entities based upon attributes in secondary tables.
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.
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.
elgg_entity_exists($guid)
Does an entity exist?
$guid
Removes an admin notice.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
get_subtype_class_from_id($subtype_id)
Returns the class name for a subtype id.
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.
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.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
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_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.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
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_view_entity_list($entities, array $vars=array())
Returns a rendered list of entities with pagination.
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_attribute_where_sql(array $options=array())
Get the join and where clauses for working with entity attributes.
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.
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
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.
get_entity($guid)
Loads and returns an entity object from a guid.
elgg_register_rss_link()
Include the RSS icon link and link element in the head.