original_string: 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);
  	}
code: 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);
  	}
code_tokens: 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 ) ; }
docstring: Get interaction statistics
  
  @param ElggEntity $entity Entity
  @return array
docstring_tokens: Get interaction statistics