39 $limit = self::DEFAULT_LOAD_LIMIT;
41 (
new QueryBuilder($this->userId))
42 ->addModeFilter($this->mode)
43 ->addPaginationFilter($this->offset, $limit)
46 $query = $queryBuilder->build();
48 $queryResult = $query->exec()->fetchAll();
50 $spaces = $this->builder->buildSpacesFromQueryResult($queryResult);
53 'hasMoreSpacesToLoad' => count($spaces) === $limit,
62 $limit = self::DEFAULT_LOAD_LIMIT;
64 (
new QueryBuilder($this->userId))
65 ->addModeFilter($this->mode)
66 ->addPaginationFilter($this->offset, $limit)
67 ->addNameSearchFilter($searchString)
70 $query = $queryBuilder->build();
72 $queryResult = $query->exec()->fetchAll();
74 $spaces = $this->builder->buildSpacesFromQueryResult($queryResult);
77 'hasMoreSpacesToLoad' => count($spaces) === $limit,
86 (
new QueryBuilder($this->userId))
87 ->addModeFilter($this->mode)
88 ->addSpaceIdFilter($spaceId)
92 $queryResult = $query->exec()->fetchAll();
94 $spaces = $this->builder->buildSpacesFromQueryResult($queryResult);
96 return $spaces[0] ??
null;
103 (
new QueryBuilder($this->userId))
104 ->addModeFilter($this->mode)
105 ->addSpaceIdListFilter($spaceIds)
106 ->addPaginationFilter(0, count($spaceIds))
110 $queryResult = $query->exec()->fetchAll();
112 return $this->builder->buildSpacesFromQueryResult($queryResult);