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

IdentityUser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A store() 0 14 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