IdentityAccount::store()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Palladium\Mapper;
4
5
use Palladium\Component\DataMapper;
6
use Palladium\Entity as Entity;
7
8
class IdentityAccount extends DataMapper
9
{
10
11
    /**
12
     * @param Entity\Identity $entity
13
     */
14 2
    public function store(Entity\Identity $entity)
15
    {
16 2
        $sql = "UPDATE {$this->table}
17
                   SET account_id = :account
18
                 WHERE identity_id = :id";
19
20 2
        $statement = $this->connection->prepare($sql);
21
22 2
        $statement->bindValue(':id', $entity->getId());
23 2
        $statement->bindValue(':account', $entity->getAccountId());
24 2
        $statement->execute();
25 2
    }
26
}
27