| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 18 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 10 | public function add($p)  | 
            ||
| 11 |     { | 
            ||
| 12 | $auth = new Auth($this->pdo, $this->prefix);  | 
            ||
| 13 | $hash = $auth->getPasswordHash($p['password']);  | 
            ||
| 14 | |||
| 15 |         $stmt = $this->pdo->prepare("INSERT INTO {$this->prefix}users SET | 
            ||
| 16 | nick = :nick, first_name = :first_name, surname = :surname, email = :email,  | 
            ||
| 17 | password = :password, active = :active");  | 
            ||
| 18 |         $stmt->bindValue(':nick', $p['nick']); | 
            ||
| 19 |         $stmt->bindValue(':first_name', $p['first_name']); | 
            ||
| 20 |         $stmt->bindValue(':surname', $p['surname']); | 
            ||
| 21 |         $stmt->bindValue(':email', $p['email']); | 
            ||
| 22 |         $stmt->bindValue(':password', $hash); | 
            ||
| 23 |         $stmt->bindValue(':active', $p['active']); | 
            ||
| 24 | $stmt->execute();  | 
            ||
| 25 | |||
| 26 | return $this->pdo->lastInsertId();  | 
            ||
| 27 | }  | 
            ||
| 28 | }  | 
            ||
| 29 |