OAuthSimple::__construct PHP Method

__construct() public method

Constructor
public __construct ( string $APIKey = "", string $sharedSecret = "" ) : OAuthSimple
$APIKey string The API Key (sometimes referred to as the consumer key) This value is usually supplied by the site you wish to use.
$sharedSecret string The shared secret. This value is also usually provided by the site you wish to use.
return OAuthSimple
    function __construct($APIKey = "", $sharedSecret = "")
    {
        if (!empty($APIKey)) {
            $this->_secrets['consumer_key'] = $APIKey;
        }
        if (!empty($sharedSecret)) {
            $this->_secrets['shared_secret'] = $sharedSecret;
        }
        $this->_default_signature_method = "HMAC-SHA1";
        $this->_action = "GET";
        $this->_nonce_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
        return $this;
    }

Usage Example

 /**
  *
  * @param TiiLTI $lti
  * @return array
  */
 public function getAssignmentInboxFormHash($lti)
 {
     $params = array('lis_person_sourcedid' => $lti->getUserId(), 'lis_lineitem_sourcedid' => $lti->getAssignmentId(), 'custom_source' => $this->getintegrationid(), 'roles' => $lti->getRole());
     if (!is_null($lti->getCustomCSS())) {
         $params['launch_presentation_css_url'] = $lti->getCustomCSS();
     }
     if (!is_null($lti->getWideMode())) {
         $params['custom_widemode'] = (int) $lti->getWideMode();
     }
     if (!is_null($lti->getStudentList())) {
         $params['custom_studentlist'] = $lti->getStudentList();
     }
     $this->setLtiParams($params);
     parent::__construct($this->accountid, $this->sharedkey);
     $this->setEndPoint($this->getApiBaseUrl() . $lti::ASSIGNMENTINBOXENDPOINT);
     $this->setParameters($this->getLtiParams());
     return array_merge($this->getLtiParams(), $this->getParamArray($params));
 }
All Usage Examples Of OAuthSimple::__construct