original_string: public function get_resourcelink_from_context(Context $context) {
          global $DB;
  
          $resourcelink = null;
          if ($resourcelinkrecord = $DB->get_record($this->resourcelinktable, ['contextid' => $context->getRecordId()],
              'ltiresourcelinkkey')) {
              $resourcelink = ResourceLink::fromContext($context, $resourcelinkrecord->ltiresourcelinkkey);
          }
  
          return $resourcelink;
      }
code: public function get_resourcelink_from_context(Context $context) {
          global $DB;
  
          $resourcelink = null;
          if ($resourcelinkrecord = $DB->get_record($this->resourcelinktable, ['contextid' => $context->getRecordId()],
              'ltiresourcelinkkey')) {
              $resourcelink = ResourceLink::fromContext($context, $resourcelinkrecord->ltiresourcelinkkey);
          }
  
          return $resourcelink;
      }
code_tokens: public function get_resourcelink_from_context ( Context $ context ) { global $ DB ; $ resourcelink = null ; if ( $ resourcelinkrecord = $ DB -> get_record ( $ this -> resourcelinktable , [ 'contextid' => $ context -> getRecordId ( ) ] , 'ltiresourcelinkkey' ) ) { $ resourcelink = ResourceLink :: fromContext ( $ context , $ resourcelinkrecord -> ltiresourcelinkkey ) ; } return $ resourcelink ; }
docstring: Fetches a resource link record that is associated with a Context object.
  
  @param Context $context
  @return ResourceLink
docstring_tokens: Fetches a resource link record that is associated with a Context object .