public static function getStats($entity) {

		if (!$entity instanceof ElggEntity) {
			return array();
		}

		$stats = array(
			'comments' => array(
				'count' => $entity->countComments()
			),
			'likes' => array(
				'count' => $entity->countAnnotations('likes'),
				'state' => (elgg_annotation_exists($entity->guid, 'likes')) ? 'after' : 'before',
			)
		);

		return elgg_trigger_plugin_hook('get_stats', 'interactions', array('entity' => $entity), $stats);
	}
public static function getStats($entity) {

		if (!$entity instanceof ElggEntity) {
			return array();
		}

		$stats = array(
			'comments' => array(
				'count' => $entity->countComments()
			),
			'likes' => array(
				'count' => $entity->countAnnotations('likes'),
				'state' => (elgg_annotation_exists($entity->guid, 'likes')) ? 'after' : 'before',
			)
		);

		return elgg_trigger_plugin_hook('get_stats', 'interactions', array('entity' => $entity), $stats);
	}
public static function getStats ( $ entity ) { if ( ! $ entity instanceof ElggEntity ) { return array ( ) ; } $ stats = array ( 'comments' => array ( 'count' => $ entity -> countComments ( ) ) , 'likes' => array ( 'count' => $ entity -> countAnnotations ( 'likes' ) , 'state' => ( elgg_annotation_exists ( $ entity -> guid , 'likes' ) ) ? 'after' : 'before' , ) ) ; return elgg_trigger_plugin_hook ( 'get_stats' , 'interactions' , array ( 'entity' => $ entity ) , $ stats ) ; }
Get interaction statistics

@param ElggEntity $entity Entity
@return array
Get interaction statistics