Completed
Branch master (53fdb9)
by Mārtiņš
04:03 queued 01:53
created

IdentityUser::store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
namespace Palladium\Mapper;
4
5
use Palladium\Component\SqlMapper;
6
use Palladium\Entity\Authentication as Entity;
7
8
class IdentityUser extends SqlMapper
9
{
10
11
    /**
12
     * @param Entity\Identity $entity
13
     */
14
    public function store(Entity\Identity $entity)
15
    {
16
        $table = $this->config['accounts']['identities'];
17
18
        $sql = "UPDATE $table
19
                   SET user_id = :user
20
                 WHERE identity_id = :id";
21
22
        $statement = $this->connection->prepare($sql);
23
24
        $statement->bindValue(':id', $entity->getId());
25
        $statement->bindValue(':user', $entity->getUserId());
26
        $statement->execute();
27
    }
28
}
29