1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace Base\OAuthServerBundle\Entity;
- use FOS\OAuthServerBundle\Entity\Client as BaseClient;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity
- */
- class OAuthClient extends BaseClient
- {
- const GRANT_TYPE_PASSWORD = 'password';
- const GRANT_TYPE_REFRESH_TOKEN = 'refresh_token';
- const GRANT_TYPE_TOKEN = 'token';
- const GRANT_TYPE_AUTHORIZATION_CODE = 'authorization_code';
-
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- protected $id;
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * @return array
- */
- public function __toString()
- {
- return strval($this->id);
- }
-
- /**
- * @return array
- */
- public static function getGrantTypesChoices()
- {
- return array(
- self::GRANT_TYPE_AUTHORIZATION_CODE => self::GRANT_TYPE_AUTHORIZATION_CODE,
- self::GRANT_TYPE_PASSWORD => self::GRANT_TYPE_PASSWORD,
- self::GRANT_TYPE_REFRESH_TOKEN => self::GRANT_TYPE_REFRESH_TOKEN,
- self::GRANT_TYPE_TOKEN => self::GRANT_TYPE_TOKEN,
- );
- }
- }
|