| @@ 599-605 (lines=7) @@ | ||
| 596 | * |
|
| 597 | * @return array |
|
| 598 | */ |
|
| 599 | public function fetchTicketById($id) |
|
| 600 | { |
|
| 601 | $conn = $this->getDbConn(); |
|
| 602 | $song = $conn->fetchAssoc('SELECT * FROM ' . self::TICKETS_TABLE . ' WHERE id = :id', ['id' => $id]); |
|
| 603 | ||
| 604 | return $song; |
|
| 605 | } |
|
| 606 | ||
| 607 | /** |
|
| 608 | * Get current value of a named setting, NULL if missing |
|
| @@ 29-36 (lines=8) @@ | ||
| 26 | * @param $key |
|
| 27 | * @return mixed|null |
|
| 28 | */ |
|
| 29 | public function fetchSetting($key) |
|
| 30 | { |
|
| 31 | $conn = $this->getDbConn(); |
|
| 32 | $row = $conn->fetchAssoc('SELECT settingValue FROM settings WHERE settingKey=:key', ['key' => $key]); |
|
| 33 | ||
| 34 | return $row ? $row['settingValue'] : null; |
|
| 35 | // rowCount seems to not work on sqlite: http://php.net/manual/en/pdostatement.rowcount.php |
|
| 36 | } |
|
| 37 | } |
|
| 38 | ||