Completed
Push — 2.x ( a081e5 )
by Daniel
15:13
created

MasterSlaveAdapter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
namespace ZfcBase\Db\Adapter;
3
use Zend\Db\Adapter\Adapter;
4
use Zend\Db\Adapter\Platform;
5
use Zend\Db\ResultSet;
6
class MasterSlaveAdapter extends Adapter implements MasterSlaveAdapterInterface
7
{
8
    /**
9
     * slave adapter
10
     *
11
     * @var Adapter
12
     */
13
    protected $slaveAdapter;
14
    /**
15
     * @param Adapter $slaveAdapter
16
     * @param Driver\DriverInterface|array $driver
17
     * @param Platform\PlatformInterface $platform
18
     * @param ResultSet\ResultSet $queryResultPrototype
19
     */
20
    public function __construct(Adapter $slaveAdapter, $driver,
21
                                Platform\PlatformInterface $platform = null,
22
                                ResultSet\ResultSetInterface $queryResultPrototype = null)
23
    {
24
        $this->slaveAdapter = $slaveAdapter;
25
        parent::__construct($driver, $platform, $queryResultPrototype);
26
    }
27
    /**
28
     * get slave adapter
29
     *
30
     * @return Adapter
31
     */
32
    public function getSlaveAdapter()
33
    {
34
        return $this->slaveAdapter;
35
    }
36
}
37