function getEntities(array $options = array())
{
$defaults = array('annotation_names' => ELGG_ENTITIES_ANY_VALUE, 'annotation_values' => ELGG_ENTITIES_ANY_VALUE, 'annotation_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE, 'annotation_name_value_pairs_operator' => 'AND', 'annotation_case_sensitive' => true, 'order_by_annotation' => array(), 'annotation_created_time_lower' => ELGG_ENTITIES_ANY_VALUE, 'annotation_created_time_upper' => ELGG_ENTITIES_ANY_VALUE, 'annotation_owner_guids' => ELGG_ENTITIES_ANY_VALUE);
$options = array_merge($defaults, $options);
$singulars = array('annotation_name', 'annotation_value', 'annotation_name_value_pair', 'annotation_owner_guid');
$options = _elgg_normalize_plural_options_array($options, $singulars);
$options = _elgg_entities_get_metastrings_options('annotation', $options);
if (!$options) {
return false;
}
$time_wheres = _elgg_get_entity_time_where_sql('n_table', $options['annotation_created_time_upper'], $options['annotation_created_time_lower']);
if ($time_wheres) {
$options['wheres'][] = $time_wheres;
}
return elgg_get_entities_from_metadata($options);
}