1 | <?php |
||
17 | class TablePrefixSubscriber implements Subscriber |
||
18 | { |
||
19 | const DEFAULT_PREFIX = 'nette_oauth2_server_'; |
||
20 | |||
21 | const ENTITIES = [ |
||
22 | AccessTokenEntity::class, |
||
23 | AuthCodeEntity::class, |
||
24 | ClientEntity::class, |
||
25 | RefreshTokenEntity::class, |
||
26 | ScopeEntity::class, |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $prefix; |
||
33 | |||
34 | /** |
||
35 | * @param string $prefix |
||
36 | */ |
||
37 | public function __construct(string $prefix = self::DEFAULT_PREFIX) |
||
41 | |||
42 | /** |
||
43 | * @param LoadClassMetadataEventArgs $eventArgs |
||
44 | */ |
||
45 | public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) |
||
63 | |||
64 | /** |
||
65 | * @return array |
||
66 | */ |
||
67 | public function getSubscribedEvents() |
||
71 | |||
72 | /** |
||
73 | * @param string $prefix |
||
74 | * @param string $name |
||
75 | * @return string |
||
76 | */ |
||
77 | protected static function getPrefixedName(string $prefix, string $name): string |
||
81 | } |
||
82 |