db->getQueryBuilder(); $qb->selectDistinct('stationuuid') ->addSelect('name') ->addSelect('favicon') ->addSelect('urlresolved') ->addSelect('bitrate') ->addSelect('country') ->addSelect('language') ->addSelect('homepage') ->addSelect('codec') ->addSelect('tags') ->from('recent') ->orderBy('id', 'DESC') ->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))) ->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); return $this->findEntity($qb); } /** * @param string $userId * @return array */ public function findAll(string $userId): array { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); $qb->selectDistinct('stationuuid') ->addSelect('name') ->addSelect('favicon') ->addSelect('urlresolved') ->addSelect('bitrate') ->addSelect('country') ->addSelect('language') ->addSelect('homepage') ->addSelect('codec') ->addSelect('tags') ->from('recent') ->orderBy('id', 'DESC') ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); return $this->findEntities($qb); } }