1 | <?php |
||
10 | class UuidDriver implements DriverInterface |
||
11 | { |
||
12 | /** |
||
13 | * The hashid manager instance. |
||
14 | * |
||
15 | * @var \ElfSundae\Laravel\Hashid\HashidManager |
||
16 | */ |
||
17 | protected $manager; |
||
18 | |||
19 | /** |
||
20 | * The hashid connection name. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $connection; |
||
25 | |||
26 | /** |
||
27 | * Create a new UUID driver instance. |
||
28 | * |
||
29 | * @param \ElfSundae\Laravel\Hashid\HashidManager $manager |
||
30 | * @param array $config |
||
31 | * |
||
32 | * @throws \InvalidArgumentException |
||
33 | */ |
||
34 | 4 | public function __construct(HashidManager $manager, array $config) |
|
42 | |||
43 | /** |
||
44 | * Encode the data. |
||
45 | * |
||
46 | * @param string|\Ramsey\Uuid\Uuid $data |
||
47 | * @return string |
||
48 | */ |
||
49 | 1 | public function encode($data) |
|
55 | |||
56 | /** |
||
57 | * Decode the data. |
||
58 | * |
||
59 | * @param string $data |
||
60 | * @return \Ramsey\Uuid\Uuid |
||
61 | */ |
||
62 | 2 | public function decode($data) |
|
71 | |||
72 | /** |
||
73 | * Get the hashid connection instance. |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | 2 | protected function getConnection() |
|
81 | } |
||
82 |