143 lines
2.5 KiB
PHP
Raw Normal View History

2013-12-24 17:01:11 +00:00
<?php
2014-01-08 16:15:29 +00:00
/**
* OAuth 2.0 Client entity
*
* @package league/oauth2-server
* @author Alex Bilbie <hello@alexbilbie.com>
2014-03-09 19:34:23 +00:00
* @copyright Copyright (c) Alex Bilbie
2014-01-08 16:15:29 +00:00
* @license http://mit-license.org/
* @link http://github.com/php-loep/oauth2-server
*/
2013-12-24 17:01:11 +00:00
2014-01-16 16:49:46 +00:00
namespace League\OAuth2\Server\Entity;
2013-12-24 17:01:11 +00:00
2014-01-08 16:15:29 +00:00
use League\OAuth2\Server\Exception\ServerException;
2014-01-10 17:30:18 +00:00
use League\OAuth2\Server\AbstractServer;
2014-01-08 16:15:29 +00:00
/**
* Client entity class
*/
2013-12-24 17:01:11 +00:00
class Client
{
2014-01-08 16:15:29 +00:00
/**
* Client identifier
* @var string
*/
2013-12-24 17:01:11 +00:00
protected $id = null;
2014-01-08 16:15:29 +00:00
/**
* Client secret
* @var string
*/
2013-12-24 17:01:11 +00:00
protected $secret = null;
2014-01-08 16:15:29 +00:00
/**
* Client name
* @var string
*/
2013-12-24 17:01:11 +00:00
protected $name = null;
2014-01-08 16:15:29 +00:00
/**
* Client redirect URI
* @var string
*/
2013-12-24 17:01:11 +00:00
protected $redirectUri = null;
2014-01-08 16:15:29 +00:00
/**
* Authorization or resource server
2014-01-16 16:49:46 +00:00
* @var \League\OAuth2\Server\AbstractServer
2014-01-08 16:15:29 +00:00
*/
protected $server;
/**
* __construct
2014-01-10 17:30:18 +00:00
* @param \League\OAuth2\Server\AbstractServer $server
2014-01-08 16:15:29 +00:00
* @return self
*/
2014-01-10 17:30:18 +00:00
public function __construct(AbstractServer $server)
2014-01-08 16:15:29 +00:00
{
2014-01-10 17:30:18 +00:00
$this->server = $server;
return $this;
2014-01-08 16:15:29 +00:00
}
/**
* Set the client identifier
* @param string $id
* @return self
*/
2013-12-24 17:01:11 +00:00
public function setId($id)
{
$this->id = $id;
return $this;
}
2014-01-08 16:15:29 +00:00
/**
* Return the client identifier
* @return string
*/
2013-12-24 17:01:11 +00:00
public function getId()
{
return $this->id;
}
2014-01-08 16:15:29 +00:00
/**
* Set the client secret
* @param string $secret
* @return self
*/
2013-12-24 17:01:11 +00:00
public function setSecret($secret)
{
$this->secret = $secret;
return $this;
}
2014-01-08 16:15:29 +00:00
/**
* Return the client secret
* @return string
*/
2013-12-24 17:01:11 +00:00
public function getSecret()
{
return $this->secret;
}
2014-01-08 16:15:29 +00:00
/**
* Set the client name
* @param string $name
* @return self
*/
2013-12-24 17:01:11 +00:00
public function setName($name)
{
$this->name = $name;
return $this;
}
2014-01-08 16:15:29 +00:00
/**
* Get the client name
* @return string
*/
2013-12-24 17:01:11 +00:00
public function getName()
{
return $this->name;
}
2014-01-08 16:15:29 +00:00
/**
* Set the client redirect URI
* @param string $redirectUri
* @return self
*/
2013-12-24 17:01:11 +00:00
public function setRedirectUri($redirectUri)
{
$this->redirectUri = $redirectUri;
return $this;
}
2014-01-08 16:15:29 +00:00
/**
* Returnt the client redirect URI
* @return string
*/
2013-12-24 17:01:11 +00:00
public function getRedirectUri()
{
return $this->redirectUri;
}
2014-01-08 16:15:29 +00:00
}