useOutboxEndpointsTableName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
namespace PSB\Persistence\Doctrine2;
3
4
5
use Doctrine\DBAL\Connection;
6
use PSB\Core\Persistence\PersistenceConfigurator;
7
8
class Doctrine2PersistenceConfigurator extends PersistenceConfigurator
9
{
10
    /**
11
     * The connection parameters are the same as described in the Doctrine DBAL documentation
12
     *
13
     * @see http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
14
     *
15
     * @param array $connectionParameters
16
     *
17
     * @return Doctrine2PersistenceConfigurator
18
     */
19 1
    public function useConnectionParameters(array $connectionParameters)
20
    {
21 1
        $this->settings->set(Doctrine2KnownSettingsEnum::CONNECTION_PARAMETERS, $connectionParameters);
22 1
        return $this;
23
    }
24
25
    /**
26
     * Instead of the connection parameters one can use an already set up connection object.
27
     *
28
     * @param Connection $dbalConnection
29
     *
30
     * @return Doctrine2PersistenceConfigurator
31
     */
32 1
    public function useConnection(Connection $dbalConnection)
33
    {
34 1
        $this->settings->set(Doctrine2KnownSettingsEnum::CONNECTION, $dbalConnection);
35 1
        return $this;
36
    }
37
38
    /**
39
     * @param string $tableName
40
     *
41
     * @return Doctrine2PersistenceConfigurator
42
     */
43 1
    public function useOutboxMessagesTableName($tableName)
44
    {
45 1
        $this->settings->set(Doctrine2KnownSettingsEnum::OUTBOX_MESSAGES_TABLE_NAME, $tableName);
46 1
        return $this;
47
    }
48
49
    /**
50
     * @param string $tableName
51
     *
52
     * @return Doctrine2PersistenceConfigurator
53
     */
54 1
    public function useOutboxEndpointsTableName($tableName)
55
    {
56 1
        $this->settings->set(Doctrine2KnownSettingsEnum::OUTBOX_ENDPOINTS_TABLE_NAME, $tableName);
57 1
        return $this;
58
    }
59
}
60