Completed
Pull Request — master (#2)
by Саша
36:16 queued 06:11
created

DbalLoader::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Extraload\Loader\Doctrine;
4
5
use Extraload\Loader\LoaderInterface;
6
use Extraload\Loader\AutoFlushLoader;
7
use Doctrine\DBAL\Connection;
8
9
class DbalLoader extends AutoFlushLoader implements LoaderInterface
10
{
11
    private $connection;
12
    private $tableName;
13
14
    public function __construct(Connection $connection, $tableName)
15
    {
16
        $this->connection = $connection;
17
        $this->tableName = $tableName;
18
    }
19
20
    public function load($data)
21
    {
22
        return $this->connection->insert($this->tableName, $data);
23
    }
24
}
25