db->getQueryBuilder(); $qb->select('*') ->from($this->tableName) ->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))); return $this->findEntity($qb); } /** * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException * @throws DoesNotExistException */ public function findByGroupId(string $groupId): Restriction { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); $qb->select('*') ->from($this->tableName) ->where($qb->expr()->eq('group_id', $qb->createNamedParameter($groupId))); return $this->findEntity($qb); } /** * @return array */ public function findByGroupIds(array $groupIds): array { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); $qb->select('*') ->from($this->tableName) ->where($qb->expr()->in('group_id', $qb->createNamedParameter($groupIds, IQueryBuilder::PARAM_STR_ARRAY))); /** @var array */ return $this->findEntities($qb); } /** * @return array */ public function findAll(): array { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); $qb->select('*') ->from($this->tableName); /** @var array */ return $this->findEntities($qb); } }