Hybrid_Providers_LinkedIn::initialize PHP Method

initialize() public method

public initialize ( )
    function initialize()
    {
        if (!$this->config["keys"]["key"] || !$this->config["keys"]["secret"]) {
            throw new Exception("Your application key and secret are required in order to connect to {$this->providerId}.", 4);
        }
        if (empty($this->config['fields'])) {
            $this->config['fields'] = array('id', 'first-name', 'last-name', 'public-profile-url', 'picture-url', 'email-address', 'date-of-birth', 'phone-numbers', 'summary', 'positions');
        }
        if (!class_exists('OAuthConsumer', false)) {
            require_once Hybrid_Auth::$config["path_libraries"] . "OAuth/OAuth.php";
        }
        require_once Hybrid_Auth::$config["path_libraries"] . "LinkedIn/LinkedIn.php";
        $this->api = new LinkedIn(array('appKey' => $this->config["keys"]["key"], 'appSecret' => $this->config["keys"]["secret"], 'callbackUrl' => $this->endpoint));
        if ($this->token("access_token_linkedin")) {
            $this->api->setTokenAccess($this->token("access_token_linkedin"));
        }
    }