* search reports by search string * @param $searchString * @return array * @throws Exception */
($searchString)
| 250 | * @throws Exception |
| 251 | */ |
| 252 | public function search($searchString) |
| 253 | { |
| 254 | $sql = $this->db->getQueryBuilder(); |
| 255 | $sql->from(self::TABLE_NAME) |
| 256 | ->select('id') |
| 257 | ->addSelect('name') |
| 258 | ->where($sql->expr()->eq('user_id', $sql->createNamedParameter($this->userId))) |
| 259 | ->andWhere($sql->expr()->iLike('name', $sql->createNamedParameter('%' . $this->db->escapeLikeParameter($searchString) . '%'))) |
| 260 | ->orderBy('name', 'ASC'); |
| 261 | $statement = $sql->executeQuery(); |
| 262 | $result = $statement->fetchAll(); |
| 263 | $statement->closeCursor(); |
| 264 | |
| 265 | return $result; |
| 266 | } |
| 267 | |
| 268 | |
| 269 | /** |