public function get_contexts_from_consumer(ToolConsumer $consumer) {
        global $DB;

        $contexts = [];
        $contextrecords = $DB->get_records($this->contexttable, ['consumerid' => $consumer->getRecordId()], '', 'lticontextkey');
        foreach ($contextrecords as $record) {
            $context = Context::fromConsumer($consumer, $record->lticontextkey);
            $contexts[] = $context;
        }

        return $contexts;
    }
public function get_contexts_from_consumer(ToolConsumer $consumer) {
        global $DB;

        $contexts = [];
        $contextrecords = $DB->get_records($this->contexttable, ['consumerid' => $consumer->getRecordId()], '', 'lticontextkey');
        foreach ($contextrecords as $record) {
            $context = Context::fromConsumer($consumer, $record->lticontextkey);
            $contexts[] = $context;
        }

        return $contexts;
    }
public function get_contexts_from_consumer ( ToolConsumer $ consumer ) { global $ DB ; $ contexts = [ ] ; $ contextrecords = $ DB -> get_records ( $ this -> contexttable , [ 'consumerid' => $ consumer -> getRecordId ( ) ] , '' , 'lticontextkey' ) ; foreach ( $ contextrecords as $ record ) { $ context = Context :: fromConsumer ( $ consumer , $ record -> lticontextkey ) ; $ contexts [ ] = $ context ; } return $ contexts ; }
Fetches the list of Context objects that are linked to a ToolConsumer.

@param ToolConsumer $consumer
@return Context[]
Fetches the list of Context objects that are linked to a ToolConsumer .