mirror of https://github.com/sualko/cloud_bbb
parent
0c3636da37
commit
4115990bb1
|
@ -50,6 +50,20 @@ class RoomMapper extends QBMapper {
|
|||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Room>
|
||||
*/
|
||||
public function findByUserId(string $userId): array {
|
||||
/* @var $qb IQueryBuilder */
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from($this->tableName, 'r')
|
||||
->where($qb->expr()->eq('r.user_id', $qb->createNamedParameter($userId)));
|
||||
|
||||
/** @var array<Room> */
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Room>
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,7 @@ class UserDeletedListener implements IEventListener {
|
|||
}
|
||||
|
||||
$userId = $event->getUser()->getUID();
|
||||
$rooms = $this->roomService->findAll($userId, [], []);
|
||||
$rooms = $this->roomService->findByUserId($userId);
|
||||
|
||||
$this->deleteSharesByUserId($userId);
|
||||
|
||||
|
|
|
@ -66,6 +66,13 @@ class RoomService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Room>
|
||||
*/
|
||||
public function findByUserId(string $userId): array {
|
||||
return $this->mapper->findByUserId($userId);
|
||||
}
|
||||
|
||||
public function create(string $name, string $welcome, int $maxParticipants, bool $record, string $access, string $userId): \OCP\AppFramework\Db\Entity {
|
||||
$room = new Room();
|
||||
|
||||
|
|
Loading…
Reference in New Issue