Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function storeNewTicket($title, $songId) |
||
30 | { |
||
31 | $conn = $this->getDbConn(); |
||
32 | $max = $conn->fetchAssoc('SELECT max(`offset`) AS o FROM tickets'); |
||
33 | |||
34 | $maxOffset = $max['o']; |
||
35 | $ticket = [ |
||
36 | 'title' => $title, |
||
37 | 'offset' => $maxOffset + 1, |
||
38 | 'songId' => $songId, |
||
39 | ]; |
||
40 | $res = $conn->insert(self::TICKETS_TABLE, $ticket); |
||
41 | |||
42 | return $res ? $conn->lastInsertId() : false; |
||
|
|||
43 | } |
||
44 | |||
68 |