DbalLoader::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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