Elgg  Version 4.3
deprecated-4.1.php
Go to the documentation of this file.
1 <?php
15 function elgg_get_version($human_readable = false) {
16 
17  if ($human_readable) {
18  elgg_deprecated_notice(__METHOD__ . ' has been deprecated, use elgg_get_release()', '4.1');
19  return elgg_get_release();
20  }
21 
22  elgg_deprecated_notice(__METHOD__ . ' has been deprecated. Do not rely on the version number. Instead use elgg_get_release() to get a release tag.', '4.1');
23  return '2017041200';
24 }
25 
36  elgg_deprecated_notice(__METHOD__ . ' has been deprecated.', '4.1');
37  return _elgg_services()->views->doesViewtypeFallback($viewtype);
38 }
39 
50  elgg_deprecated_notice(__METHOD__ . ' has been deprecated. Use elgg_entity_enable_capability().', '4.1');
51 
52  $type = strtolower($type);
53  if (!in_array($type, \Elgg\Config::ENTITY_TYPES)) {
54  return false;
55  }
56 
57  if (!empty($subtype)) {
58  _elgg_services()->entity_capabilities->setCapability($type, $subtype, 'searchable', true);
59  }
60 
61  return true;
62 }
63 
74  elgg_deprecated_notice(__METHOD__ . ' has been deprecated. Use elgg_entity_disable_capability().', '4.1');
75 
76  $type = strtolower($type);
77  if (!in_array($type, \Elgg\Config::ENTITY_TYPES)) {
78  return false;
79  }
80 
81  if (!empty($subtype)) {
82  _elgg_services()->entity_capabilities->setCapability($type, $subtype, 'searchable', false);
83  }
84 
85  return true;
86 }
87 
97  elgg_deprecated_notice(__METHOD__ . ' has been deprecated. Use elgg_entity_types_with_capability().', '4.1');
98 
99  $entities = _elgg_services()->entity_capabilities->getTypesWithCapability('searchable');
100  if (empty($entities)) {
101  return false;
102  }
103 
104  if ($type) {
105  $type = strtolower($type);
106  }
107 
108  if (!empty($type) && !isset($entities[$type])) {
109  return false;
110  }
111 
112  return empty($type) ? $entities : $entities[$type];
113 }
114 
125  elgg_deprecated_notice(__METHOD__ . ' has been deprecated. Use elgg_entity_has_capability().', '4.1');
126 
127  if (empty($subtype)) {
128  return true;
129  }
130 
131  return _elgg_services()->entity_capabilities->hasCapability($type, $subtype, 'searchable');
132 }
133 
142 function get_user_by_code($hash) {
143  elgg_deprecated_notice(__METHOD__ . ' has been deprecated. Use elgg_get_user_by_persistent_token().', '4.1');
144 
145  return _elgg_services()->persistentLogin->getUserFromHash($hash);
146 }
elgg_get_release()
Get the current Elgg release.
elgg_unregister_entity_type($type, $subtype=null)
Unregisters an entity type and subtype as a public-facing type.
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
Definition: deprecation.php:52
is_registered_entity_type($type, $subtype=null)
Returns if the entity type and subtype have been registered with elgg_register_entity_type().
$type
Definition: delete.php:21
elgg_does_viewtype_fallback($viewtype)
Checks if a viewtype falls back to default.
$viewtype
Definition: default.php:11
elgg_register_entity_type($type, $subtype=null)
Registers an entity type and subtype as a public-facing entity that should be shown in search...
$subtype
Definition: delete.php:22
_elgg_services()
Get the global service provider.
Definition: elgglib.php:638
get_user_by_code($hash)
Get user by persistent login password.
elgg_get_version($human_readable=false)
Bundle all functions which have been deprecated in Elgg 4.1.
get_registered_entity_types($type=null)
Returns registered entity types and subtypes.