public countAnnotations ( string $name = "" ) : integer | ||
$name | string | The type of annotation. |
return | integer |
public function countAnnotations($name = "")
{
return $this->getAnnotationCalculation($name, 'count');
}
/** * Count how many people have liked an entity. * * @param ElggEntity $entity * * @return int Number of likes */ function likes_count($entity) { $type = $entity->getType(); $params = array('entity' => $entity); $number = elgg_trigger_plugin_hook('likes:count', $type, $params, false); if ($number) { return $number; } else { return $entity->countAnnotations('likes'); } }