public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null)
	{
		// format date like HUBzero does
		$expires = with(new Date($expires))->toSql();

		// get the id for th client
		$client = $this->getClientDetails($client_id);

		// create authorization code 
		$model = new \Components\Developer\Models\Authorizationcode();
		$model->set('application_id', $client['id']);
		$model->set('authorization_code', $code);
		$model->set('uidNumber', $user_id);
		$model->set('redirect_uri', $redirect_uri);
		$model->set('expires', $expires);
		return $model->save();
	}
public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null)
	{
		// format date like HUBzero does
		$expires = with(new Date($expires))->toSql();

		// get the id for th client
		$client = $this->getClientDetails($client_id);

		// create authorization code 
		$model = new \Components\Developer\Models\Authorizationcode();
		$model->set('application_id', $client['id']);
		$model->set('authorization_code', $code);
		$model->set('uidNumber', $user_id);
		$model->set('redirect_uri', $redirect_uri);
		$model->set('expires', $expires);
		return $model->save();
	}
public function setAuthorizationCode ( $ code , $ client_id , $ user_id , $ redirect_uri , $ expires , $ scope = null ) { // format date like HUBzero does $ expires = with ( new Date ( $ expires ) ) -> toSql ( ) ; // get the id for th client $ client = $ this -> getClientDetails ( $ client_id ) ; // create authorization code  $ model = new \ Components \ Developer \ Models \ Authorizationcode ( ) ; $ model -> set ( 'application_id' , $ client [ 'id' ] ) ; $ model -> set ( 'authorization_code' , $ code ) ; $ model -> set ( 'uidNumber' , $ user_id ) ; $ model -> set ( 'redirect_uri' , $ redirect_uri ) ; $ model -> set ( 'expires' , $ expires ) ; return $ model -> save ( ) ; }
Create new authorization code

@param   string  $code          Authorization code
@param   string  $client_id     Client id
@param   int     $user_id       User identifier
@param   string  $redirect_uri  Redirect URI after authorization
@param   string  $expires       Code expiration
@param   string  $scope         Code scope
@return  bool
Create new authorization code