* get reports for user * @param $userId * @return array * @throws Exception */
($userId)
| 61 | * @throws Exception |
| 62 | */ |
| 63 | public function indexByUser($userId) |
| 64 | { |
| 65 | $sql = $this->db->getQueryBuilder(); |
| 66 | $sql->from(self::TABLE_NAME) |
| 67 | ->select('id') |
| 68 | ->where($sql->expr()->eq('user_id', $sql->createNamedParameter($userId))); |
| 69 | $statement = $sql->executeQuery(); |
| 70 | $result = $statement->fetchAll(); |
| 71 | $statement->closeCursor(); |
| 72 | return $result; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * create report |