Returns the documents associated with this glossary entry id.

@param stdClass $entry glossary entry.
@param array    $options
@return \core_search\document
340709
public function get_document($entry, $options = array()) {
        global $DB;

        $keywords = array();
        if ($aliases = $DB->get_records('glossary_alias', array('entryid' => $entry->id))) {
            foreach ($aliases as $alias) {
                $keywords[] = $alias->alias;
            }
        }

        try {
            $cm = $this->get_cm('glossary', $entry->glossaryid, $entry->course);
            $context = \context_module::instance($cm->id);
        } catch (\dml_missing_record_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving mod_glossary ' . $entry->id . ' document, not all required data is available: ' .
                $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        } catch (\dml_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving mod_glossary' . $entry->id . ' document: ' . $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        }

        // Prepare associative array with data from DB.
        $doc = \core_search\document_factory::instance($entry->id, $this->componentname, $this->areaname);
        $doc->set('title', content_to_text($entry->concept, false));
        $doc->set('content', content_to_text($entry->definition, $entry->definitionformat));
        $doc->set('contextid', $context->id);
        $doc->set('courseid', $entry->course);
        $doc->set('userid', $entry->userid);
        $doc->set('owneruserid', \core_search\manager::NO_OWNER_ID);
        $doc->set('modified', $entry->timemodified);

        // Check if this document should be considered new.
        if (isset($options['lastindexedtime']) && ($options['lastindexedtime'] < $entry->timecreated)) {
            // If the document was created after the last index time, it must be new.
            $doc->set_is_new(true);
        }

        // Adding keywords as extra info.
        if ($keywords) {
            // No need to pass through content_to_text here as this is just a list of keywords.
            $doc->set('description1', implode(' ' , $keywords));
        }

        return $doc;
    }
860301
private static function extractBulkWriteOptions(array $options)
    {
        $definedBulkOptions = ['bypassDocumentValidation', 'ordered', 'writeConcern'];
        $bulkWriteOptions = array_intersect_key($options, array_flip($definedBulkOptions));
        $operationOptions = array_diff_key($options, $bulkWriteOptions);

        return [$bulkWriteOptions, $operationOptions];
    }
663600
public function getBuyableDescription($options = null)
    {
        if(property_exists($this, 'name')) return $this->name;
        if(property_exists($this, 'title')) return $this->title;
        if(property_exists($this, 'description')) return $this->description;

        return null;
    }
274707
protected static function fill_entry_details($entry, $context) {
        global $PAGE;
        $canviewfullnames = has_capability('moodle/site:viewfullnames', $context);

        // Format concept and definition.
        $entry->concept = external_format_string($entry->concept, $context->id);
        list($entry->definition, $entry->definitionformat) = external_format_text($entry->definition, $entry->definitionformat,
            $context->id, 'mod_glossary', 'entry', $entry->id);

        // Author details.
        $user = mod_glossary_entry_query_builder::get_user_from_record($entry);
        $userpicture = new user_picture($user);
        $userpicture->size = 1;
        $entry->userfullname = fullname($user, $canviewfullnames);
        $entry->userpictureurl = $userpicture->get_url($PAGE)->out(false);

        // Fetch attachments.
        $entry->attachment = !empty($entry->attachment) ? 1 : 0;
        $entry->attachments = array();
        if ($entry->attachment) {
            $entry->attachments = external_util::get_area_files($context->id, 'mod_glossary', 'attachment', $entry->id);
        }
        $definitioninlinefiles = external_util::get_area_files($context->id, 'mod_glossary', 'entry', $entry->id);
        if (!empty($definitioninlinefiles)) {
            $entry->definitioninlinefiles = $definitioninlinefiles;
        }

        $entry->tags = \core_tag\external\util::get_item_tags('mod_glossary', 'glossary_entries', $entry->id);
    }
385795
public function getIdNameMap( $options = [] ) {

		$map = parent::getIdNameMap( $options );

		if( isset( $options[ 'default' ] ) && $options[ 'default' ] ) {

			unset( $options[ 'default' ] );

			$map = ArrayHelper::merge( [ '0' => 'Choose Theme' ], $map );
		}

		return $map;
	}
78491
public function serialize(Keyword $keyword, array $options = [])
    {
        $serialized = [
            'id' => $keyword->getUuid(),
            'name' => $keyword->getName(),
        ];

        return $serialized;
    }
198140
public function get_document($record, $options = array()) {

        $context = \context_system::instance();

        // Prepare associative array with data from DB.
        $doc = \core_search\document_factory::instance($record->id, $this->componentname, $this->areaname);
        // Include all alternate names in title.
        $array = [];
        foreach (get_all_user_name_fields(false, null, null, null, true) as $field) {
            $array[$field] = $record->$field;
        }
        $fullusername = join(' ', $array);
        // Assigning properties to our document.
        $doc->set('title', content_to_text($fullusername, false));
        $doc->set('contextid', $context->id);
        $doc->set('courseid', SITEID);
        $doc->set('itemid', $record->id);
        $doc->set('modified', $record->timemodified);
        $doc->set('owneruserid', \core_search\manager::NO_OWNER_ID);
        $doc->set('content', content_to_text($record->description, $record->descriptionformat));

        // Check if this document should be considered new.
        if (isset($options['lastindexedtime']) && $options['lastindexedtime'] < $record->timecreated) {
            // If the document was created after the last index time, it must be new.
            $doc->set_is_new(true);
        }

        return $doc;
    }
389697
public function getById($id, array $options = [])
    {
        $query = $this->createBaseBuilder($options);

        return $query->find($id);
    }
98973
public function getResults(array $options = []) : ?SavedSearch
    {
        $this->setContainerId($options['entity']);

        $table = TableRegistry::get('Search.SavedSearches');

        /** @var \Search\Model\Entity\SavedSearch|null */
        $savedSearch = $table->find()
            ->where(['id' => $this->widget->get('widget_id')])
            ->enableHydration(true)
            ->first();

        if (null === $savedSearch) {
            $this->errors[] = 'No data found for this entity';

            return null;
        }

        /** @var \Cake\Datasource\RepositoryInterface */
        $table = TableRegistry::get($savedSearch->get('model'));

        $search = new Search($table, $options['user']);
        // keeps backward compatibility
        $entity = $search->reset($savedSearch);
        if (null === $entity) {
            $this->errors[] = 'Failed to reset entity';

            return null;
        }
        $content = $entity->get('content');
        $content['saved'] = Validator::validateData($table, $content['saved'], $options['user']);
        $entity->set('content', $content);

        $this->options['fields'] = Utility::instance()->getSearchableFields($table, $options['user']);
        $this->options['associationLabels'] = Utility::instance()->getAssociationLabels($table);

        $this->data = $entity;

        return $this->data;
    }
156988
public static function find($options = [])
    {
        $options = Set::extend(static::query(), $options);
        $schema = static::definition();
        return $schema->query(['query' => $options] + ['finders' => static::finders()]);
    }
536960
public function getData($options)
    {
        $this->checkRequiredParameters($options, [$this->optionsIdKey]);

        $transitions = $this->transitionResolver->getTransitions(
            $this->transitionKey,
            $options[$this->optionsIdKey]
        );

        /** @var TransitionResultInterface $transition */
        if (isset($transitions['previous'])) {
            foreach ($transitions['previous'] as $transition) {
                $this->addTransitionToEntries($transition);
            }
        }

        /** @var TransitionResultInterface $transition */
        $transition = $transitions['current'];
        $this->addTransitionToEntries($transition);

        if (isset($transitions['following'])) {
            /** @var TransitionResultInterface $transition */
            foreach ($transitions['following'] as $transition) {
                $this->addTransitionToEntries($transition);
            }
        }

        return parent::serializeData();
    }
987252
public function getObject(array $options = array())
    {
        $content = $this->getContent();

        if (is_null($content)) {
            return (object)$content;
        }

        return json_decode($this->content, false);
    }
824823
public function get_document($record, $options = array()) {
        global $PAGE;

        try {
            $context = \context_course::instance($record->instanceid);
        } catch (\moodle_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document, not all required data is available: ' .
                $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        }

        $handler = course_handler::create();
        $field = $handler->get_fields()[$record->fieldid];
        $data = data_controller::create(0, $record, $field);

        // Prepare associative array with data from DB.
        $doc = \core_search\document_factory::instance($record->id, $this->componentname, $this->areaname);
        $doc->set('title', content_to_text($field->get('name'), false));
        $doc->set('content', content_to_text($data->export_value(), FORMAT_HTML));
        $doc->set('contextid', $context->id);
        $doc->set('courseid', $context->instanceid);
        $doc->set('owneruserid', \core_search\manager::NO_OWNER_ID);
        $doc->set('modified', $record->timemodified);

        // Check if this document should be considered new.
        if (isset($options['lastindexedtime']) && ($options['lastindexedtime'] < $record->timecreated)) {
            // If the document was created after the last index time, it must be new.
            $doc->set_is_new(true);
        }

        return $doc;
    }
724662
public function invoices(array $options = [])
    {
        if (!isset($this->invoices)) {
            $options['customer_uuid'] = $this->uuid;
            $this->invoices = CustomerInvoices::all($options)->invoices;
        }
        return $this->invoices;
    }
1162704
public function getQuery(array $options = []) : Query
    {
        $documentPersister = $this->dm->getUnitOfWork()->getDocumentPersister($this->class->name);

        $query = $this->query;

        $query['query'] = $this->expr->getQuery();
        $query['query'] = $documentPersister->addDiscriminatorToPreparedQuery($query['query']);
        $query['query'] = $documentPersister->addFilterToPreparedQuery($query['query']);

        $query['newObj'] = $this->expr->getNewObj();

        if (isset($query['distinct'])) {
            $query['distinct'] = $documentPersister->prepareFieldName($query['distinct']);
        }

        if ($this->class->inheritanceType === ClassMetadata::INHERITANCE_TYPE_SINGLE_COLLECTION && ! empty($query['upsert']) &&
            (empty($query['query'][$this->class->discriminatorField]) || is_array($query['query'][$this->class->discriminatorField]))) {
            throw new InvalidArgumentException('Upsert query that is to be performed on discriminated document does not have single ' .
                'discriminator. Either not use base class or set \'' . $this->class->discriminatorField . '\' field manually.');
        }

        if (! empty($query['select'])) {
            $query['select'] = $documentPersister->prepareProjection($query['select']);
            if ($this->hydrate && $this->class->inheritanceType === ClassMetadata::INHERITANCE_TYPE_SINGLE_COLLECTION
                && ! isset($query['select'][$this->class->discriminatorField])) {
                $includeMode = 0 < count(array_filter($query['select'], static function ($mode) {
                    return $mode === 1;
                }));
                if ($includeMode && ! isset($query['select'][$this->class->discriminatorField])) {
                    $query['select'][$this->class->discriminatorField] = 1;
                }
            }
        }

        if (isset($query['sort'])) {
            $query['sort'] = $documentPersister->prepareSort($query['sort']);
        }

        if ($this->class->readPreference && ! array_key_exists('readPreference', $query)) {
            $query['readPreference'] = new ReadPreference($this->class->readPreference, $this->class->readPreferenceTags);
        }

        return new Query(
            $this->dm,
            $this->class,
            $this->collection,
            $query,
            $options,
            $this->hydrate,
            $this->refresh,
            $this->primers,
            $this->readOnly
        );
    }
1073939
public function get($className , array $options = array())  {
        
        $Query = $this->getServiceLocator()->get($className);
        if($this->isValidClass($Query)) {
            return $Query->setServiceLocator($this->getServiceLocator())->setOptions($options);
        }
    }
194552
public function getCollection(array $options = array())
    {
        /** @var ClientEntity[] $collection */
        $collection = $this->getRepository()->findAll();
        $resource   = new Resource($this->generateBrowseUrl(), array('count' => count($collection)));

        foreach ($collection as $element) {
            $resource->setEmbedded('client', $this->createResourceFromClient($element));
        }

        return $resource;
    }