db->getQueryBuilder(); $qb->select('*') ->from($this->tableName) ->where( $qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)), $qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)) ); return $this->findEntity($qb); } public function findAll($userId) { $qb = $this->db->getQueryBuilder(); $qb->select('*') ->from($this->tableName) ->where( $qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)) ); return $this->findEntities($qb); } public function colorIdCount($colorid) { $qb = $this->db->getQueryBuilder(); $qb->select('id') ->from($this->tableName) ->where( $qb->expr()->eq('color_id', $qb->createNamedParameter($colorid, IQueryBuilder::PARAM_INT)) ); return count($this->findEntities($qb)); } }