1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace DoctrineModule\Options; |
6
|
|
|
|
7
|
|
|
use Laminas\Stdlib\AbstractOptions; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* MappingDriver options |
11
|
|
|
* |
12
|
|
|
* @link http://www.doctrine-project.org/ |
13
|
|
|
*/ |
14
|
|
|
class Driver extends AbstractOptions |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* The class name of the Driver. |
18
|
|
|
* |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
protected $class; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* All drivers (except DriverChain) require paths to work on. You |
25
|
|
|
* may set this value as a string (for a single path) or an array |
26
|
|
|
* for multiple paths. |
27
|
|
|
* |
28
|
|
|
* @var mixed[] |
29
|
|
|
*/ |
30
|
|
|
protected $paths = []; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Set the cache key for the annotation cache. Cache key |
34
|
|
|
* is assembled as "doctrine.cache.{key}" and pulled from |
35
|
|
|
* service locator. This option is only valid for the |
36
|
|
|
* AnnotationDriver. |
37
|
|
|
* |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
protected $cache = 'array'; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Set the file extension to use. This option is only |
44
|
|
|
* valid for FileDrivers (XmlDriver, YamlDriver, PHPDriver, etc). |
45
|
|
|
* |
46
|
|
|
* @var string|null |
47
|
|
|
*/ |
48
|
|
|
protected $extension = null; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Set the driver keys to use which are assembled as |
52
|
|
|
* "doctrine.driver.{key}" and pulled from the service |
53
|
|
|
* locator. This option is only valid for DriverChain. |
54
|
|
|
* |
55
|
|
|
* @var mixed[] |
56
|
|
|
*/ |
57
|
|
|
protected $drivers = []; |
58
|
|
|
|
59
|
|
|
public function setCache(string $cache) : void |
60
|
|
|
{ |
61
|
|
|
$this->cache = $cache; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getCache() : string |
65
|
|
|
{ |
66
|
|
|
return 'doctrine.cache.' . $this->cache; |
67
|
|
|
} |
68
|
|
|
|
69
|
2 |
|
public function setClass(string $class) : void |
70
|
|
|
{ |
71
|
2 |
|
$this->class = $class; |
72
|
2 |
|
} |
73
|
|
|
|
74
|
2 |
|
public function getClass() : string |
75
|
|
|
{ |
76
|
2 |
|
return $this->class; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @param mixed[] $drivers |
81
|
|
|
*/ |
82
|
1 |
|
public function setDrivers(array $drivers) : void |
83
|
|
|
{ |
84
|
1 |
|
$this->drivers = $drivers; |
85
|
1 |
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return mixed[] |
89
|
|
|
*/ |
90
|
1 |
|
public function getDrivers() : array |
91
|
|
|
{ |
92
|
1 |
|
return $this->drivers; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @param null $extension |
97
|
|
|
*/ |
98
|
|
|
public function setExtension($extension) : void |
99
|
|
|
{ |
100
|
|
|
$this->extension = $extension; |
101
|
|
|
} |
102
|
|
|
|
103
|
2 |
|
public function getExtension() : ?string |
104
|
|
|
{ |
105
|
2 |
|
return $this->extension; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @param mixed[] $paths |
110
|
|
|
*/ |
111
|
|
|
public function setPaths(array $paths) : void |
112
|
|
|
{ |
113
|
|
|
$this->paths = $paths; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return mixed[] |
118
|
|
|
*/ |
119
|
2 |
|
public function getPaths() : array |
120
|
|
|
{ |
121
|
2 |
|
return $this->paths; |
122
|
|
|
} |
123
|
|
|
} |
124
|
|
|
|