| @@ 385-396 (lines=12) @@ | ||
| 382 | * |
|
| 383 | * @internal param Circle $circle |
|
| 384 | */ |
|
| 385 | public function destroy($circleId) { |
|
| 386 | $qb = $this->db->getQueryBuilder(); |
|
| 387 | $qb->delete(self::TABLENAME) |
|
| 388 | ->where( |
|
| 389 | $qb->expr() |
|
| 390 | ->eq( |
|
| 391 | 'id', $qb->createNamedParameter($circleId) |
|
| 392 | ) |
|
| 393 | ); |
|
| 394 | ||
| 395 | $qb->execute(); |
|
| 396 | } |
|
| 397 | ||
| 398 | ||
| 399 | /** |
|
| @@ 284-296 (lines=13) @@ | ||
| 281 | * |
|
| 282 | * @return bool |
|
| 283 | */ |
|
| 284 | public function removeAllFromCircle($circleId) { |
|
| 285 | $qb = $this->db->getQueryBuilder(); |
|
| 286 | $qb->delete(self::TABLENAME) |
|
| 287 | ->where( |
|
| 288 | $qb->expr() |
|
| 289 | ->eq('circle_id', $qb->createNamedParameter($circleId)) |
|
| 290 | ); |
|
| 291 | ||
| 292 | $qb->execute(); |
|
| 293 | ||
| 294 | return true; |
|
| 295 | } |
|
| 296 | ||
| 297 | ||
| 298 | /** |
|
| 299 | * remove all members/owner from a circle |
|
| @@ 305-316 (lines=12) @@ | ||
| 302 | * |
|
| 303 | * @return bool |
|
| 304 | */ |
|
| 305 | public function removeAllFromUserId($userId) { |
|
| 306 | $qb = $this->db->getQueryBuilder(); |
|
| 307 | $qb->delete(self::TABLENAME) |
|
| 308 | ->where( |
|
| 309 | $qb->expr() |
|
| 310 | ->eq('user_id', $qb->createNamedParameter($userId)) |
|
| 311 | ); |
|
| 312 | ||
| 313 | $qb->execute(); |
|
| 314 | ||
| 315 | return true; |
|
| 316 | } |
|
| 317 | } |
|
| 318 | ||
| 319 | ||