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');
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
elgg_delete_annotations(array $options)
Deletes annotations based on $options.
if(!$user||!$user->canDelete()) $name
elgg_get_annotations(array $options=[])
Fetch annotations or perform a calculation on them.
countAnnotations(string $name= '')
Count annotations.
getAnnotationsMin(string $name)
Get the minimum of integer type annotations of given name.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
const ELGG_IGNORE_ACCESS
elgg_call() flags
annotate($name, $value, $access_id=ACCESS_PRIVATE, $owner_guid=0, $value_type= '')
Adds an annotation to an entity.
getAnnotationsMax(string $name)
Get the maximum of integer type annotations of a given name.
getAnnotationsAvg(string $name)
Get the average of an integer type annotation.
getAnnotations(array $options=[])
Gets an array of annotations.
getAnnotationsSum(string $name)
Get the sum of integer type annotations of a given name.
_elgg_services()
Get the global service provider.
deleteAnnotations(string $name=null)
Deletes all annotations on this object (annotations.entity_guid = $this->guid).
deleteOwnedAnnotations(string $name=null)
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid).
$guid
Reset an ElggUpgrade.