original_string: public static function fromContext($context, $ltiResourceLinkId, $tempId = null)
      {
  
          $resourceLink = new ResourceLink();
          $resourceLink->setContextId($context->getRecordId());
          $resourceLink->context = $context;
          $resourceLink->dataConnector = $context->getDataConnector();
          $resourceLink->ltiResourceLinkId = $ltiResourceLinkId;
          if (!empty($ltiResourceLinkId)) {
              $resourceLink->load();
              if (is_null($resourceLink->id) && !empty($tempId)) {
                  $resourceLink->ltiResourceLinkId = $tempId;
                  $resourceLink->load();
                  $resourceLink->ltiResourceLinkId = $ltiResourceLinkId;
              }
          }
  
          return $resourceLink;
  
      }
code: public static function fromContext($context, $ltiResourceLinkId, $tempId = null)
      {
  
          $resourceLink = new ResourceLink();
          $resourceLink->setContextId($context->getRecordId());
          $resourceLink->context = $context;
          $resourceLink->dataConnector = $context->getDataConnector();
          $resourceLink->ltiResourceLinkId = $ltiResourceLinkId;
          if (!empty($ltiResourceLinkId)) {
              $resourceLink->load();
              if (is_null($resourceLink->id) && !empty($tempId)) {
                  $resourceLink->ltiResourceLinkId = $tempId;
                  $resourceLink->load();
                  $resourceLink->ltiResourceLinkId = $ltiResourceLinkId;
              }
          }
  
          return $resourceLink;
  
      }
code_tokens: public static function fromContext ( $ context , $ ltiResourceLinkId , $ tempId = null ) { $ resourceLink = new ResourceLink ( ) ; $ resourceLink -> setContextId ( $ context -> getRecordId ( ) ) ; $ resourceLink -> context = $ context ; $ resourceLink -> dataConnector = $ context -> getDataConnector ( ) ; $ resourceLink -> ltiResourceLinkId = $ ltiResourceLinkId ; if ( ! empty ( $ ltiResourceLinkId ) ) { $ resourceLink -> load ( ) ; if ( is_null ( $ resourceLink -> id ) && ! empty ( $ tempId ) ) { $ resourceLink -> ltiResourceLinkId = $ tempId ; $ resourceLink -> load ( ) ; $ resourceLink -> ltiResourceLinkId = $ ltiResourceLinkId ; } } return $ resourceLink ; }
docstring: Class constructor from context.
  
  @param Context $context Context object
  @param string $ltiResourceLinkId Resource link ID value
  @param string $tempId Temporary Resource link ID value (optional, default is null)
  @return ResourceLink
docstring_tokens: Class constructor from context .