1 | <?php |
||
7 | use Laminas\Stdlib\AbstractOptions; |
||
8 | |||
9 | class EntityManager extends AbstractOptions |
||
10 | { |
||
11 | /** |
||
12 | * Set the configuration key for the Configuration. Configuration key |
||
13 | * is assembled as "doctrine.configuration.{key}" and pulled from |
||
14 | * service locator. |
||
15 | */ |
||
16 | protected string $configuration = 'orm_default'; |
||
|
|||
17 | |||
18 | /** |
||
19 | * Set the connection key for the Connection. Connection key |
||
20 | * is assembled as "doctrine.connection.{key}" and pulled from |
||
21 | * service locator. |
||
22 | */ |
||
23 | protected string $connection = 'orm_default'; |
||
24 | |||
25 | /** |
||
26 | * Set the connection key for the EntityResolver, which is |
||
27 | * a service of type {@see \Doctrine\ORM\Tools\ResolveTargetEntityListener}. |
||
28 | * The EntityResolver service name is assembled |
||
29 | * as "doctrine.entity_resolver.{key}" |
||
30 | */ |
||
31 | protected string $entityResolver = 'orm_default'; |
||
32 | |||
33 | public function setConfiguration(string $configuration) : self |
||
34 | { |
||
35 | $this->configuration = $configuration; |
||
36 | |||
37 | return $this; |
||
38 | } |
||
39 | |||
40 | public function getConfiguration() : string |
||
41 | 72 | { |
|
42 | return 'doctrine.configuration.' . $this->configuration; |
||
43 | 72 | } |
|
44 | |||
45 | 72 | public function setConnection(string $connection) : self |
|
46 | { |
||
47 | $this->connection = $connection; |
||
48 | |||
49 | return $this; |
||
50 | } |
||
51 | 72 | ||
52 | /** |
||
53 | 72 | * @return self |
|
54 | */ |
||
55 | public function getConnection() : string |
||
56 | { |
||
57 | return 'doctrine.connection.' . $this->connection; |
||
58 | } |
||
59 | |||
60 | 72 | public function setEntityResolver(string $entityResolver) : self |
|
61 | { |
||
62 | 72 | $this->entityResolver = (string) $entityResolver; |
|
63 | |||
64 | 72 | return $this; |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return self |
||
69 | */ |
||
70 | public function getEntityResolver() : string |
||
71 | 72 | { |
|
72 | return 'doctrine.entity_resolver.' . $this->entityResolver; |
||
73 | 72 | } |
|
74 | } |
||
75 |