18 protected array $temp_annotations = [];
34 'guid' => $this->guid,
36 'annotation_name' =>
$name,
41 unset($this->temp_annotations[
$name]);
43 $this->temp_annotations = [];
63 'annotation_owner_guid' => $this->guid,
65 'annotation_name' =>
$name,
78 private function getAnnotationCalculation(
string $name,
string $calculation): mixed {
80 'guid' => $this->guid,
82 'annotation_name' =>
$name,
83 'annotation_calculation' => $calculation
123 if (!empty($value_type)) {
153 if (isset($this->temp_annotations[
$name])) {
154 return [$this->temp_annotations[
$name]];
169 return $this->getAnnotationCalculation(
$name,
'count');
180 return $this->getAnnotationCalculation(
$name,
'avg');
191 return $this->getAnnotationCalculation(
$name,
'sum');
202 return $this->getAnnotationCalculation(
$name,
'min');
213 return $this->getAnnotationCalculation(
$name,
'max');
$guid
Reset an ElggUpgrade.
if(! $user||! $user->canDelete()) $name
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
elgg_delete_annotations(array $options)
Deletes annotations based on $options.
elgg_get_annotations(array $options=[])
Fetch annotations or perform a calculation on them.
const ELGG_IGNORE_ACCESS
elgg_call() flags
if($who_can_change_language==='nobody') elseif($who_can_change_language==='admin_only' &&!elgg_is_admin_logged_in()) $options
_elgg_services()
Get the global service provider.
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
getAnnotationsAvg(string $name)
Get the average of an integer type annotation.
annotate($name, $value, $access_id=ACCESS_PRIVATE, $owner_guid=0, $value_type='')
Adds an annotation to an entity.
getAnnotations(array $options=[])
Gets an array of annotations.
getAnnotationsSum(string $name)
Get the sum of integer type annotations of a given name.
deleteAnnotations(?string $name=null)
Deletes all annotations on this object (annotations.entity_guid = $this->guid).
countAnnotations(string $name='')
Count annotations.
trait Annotations
Bundle all annotations related functions for an \ElggEntity.
getAnnotationsMin(string $name)
Get the minimum of integer type annotations of given name.
deleteOwnedAnnotations(?string $name=null)
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid).
getAnnotationsMax(string $name)
Get the maximum of integer type annotations of a given name.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.