Elgg\Database\Annotations::find PHP Method

find() public method

Returns annotations. Accepts all elgg_get_entities() options for entity restraints.
See also: elgg_get_entities
public find ( array $options = [] ) : ElggAnnotation[] | mixed
$options array Array in format: annotation_names => null|ARR Annotation names annotation_values => null|ARR Annotation values annotation_ids => null|ARR annotation ids annotation_case_sensitive => BOOL Overall Case sensitive annotation_owner_guids => null|ARR guids for annotation owners annotation_created_time_lower => INT Lower limit for created time. annotation_created_time_upper => INT Upper limit for created time. annotation_calculation => STR Perform the MySQL function on the annotation values returned. Do not confuse this "annotation_calculation" option with the "calculation" option to elgg_get_entities_from_annotation_calculation(). The "annotation_calculation" option causes this function to return the result of performing a mathematical calculation on all annotations that match the query instead of \ElggAnnotation objects. See the docs for elgg_get_entities_from_annotation_calculation() for the proper use of the "calculation" option.
return ElggAnnotation[] | mixed
    function find(array $options = array())
    {
        // support shortcut of 'count' => true for 'annotation_calculation' => 'count'
        if (isset($options['count']) && $options['count']) {
            $options['annotation_calculation'] = 'count';
            unset($options['count']);
        }
        $options['metastring_type'] = 'annotations';
        return _elgg_get_metastring_based_objects($options);
    }