| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function insert($ranking) |
||
| 22 | { |
||
| 23 | # create a new ranking |
||
| 24 | $qr = $this->connection->prepare('INSERT INTO ranking(dRanking, player, faction) VALUES (:created_at, :is_player, :is_faction)'); |
||
| 25 | $qr->execute([ |
||
| 26 | 'created_at' => $ranking->getCreatedAt(), |
||
| 27 | 'is_player' => (int) $ranking->getIsPlayer(), |
||
| 28 | 'is_faction' => (int) $ranking->getIsFaction() |
||
| 29 | ]); |
||
| 30 | |||
| 31 | $ranking->setId($this->connection->lastInsertId()); |
||
| 32 | } |
||
| 33 | |||
| 43 | } |