Completed
Pull Request — master (#602)
by Tom
07:01
created

EntityManager   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 3
cbo 1
dl 0
loc 89
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineORMModule\Options;
6
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';
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
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