public function getCampaignsAction(ParamFetcher $paramFetcher)
    {
        try {
            $params = $paramFetcher->all();

            $qb = $this->getQueryBuilder();
            $qb->select('c');
            $qb->from('CampaignChain\CoreBundle\Entity\Campaign', 'c');

            if($params['moduleUri']){
                $qb->from('CampaignChain\CoreBundle\Entity\Bundle', 'b');
                $qb->from('CampaignChain\CoreBundle\Entity\Module', 'm');
                $qb->andWhere('b.id = m.bundle');
                $qb->andWhere('c.campaignModule = m.id');

                foreach($params['moduleUri'] as $key => $moduleUri) {
                    $moduleUriParts = explode('/', $moduleUri);
                    $vendor = $moduleUriParts[0];
                    $project = $moduleUriParts[1];
                    $identifier = $moduleUriParts[2];
                    $moduleUriQuery[] = '(b.name = :package'.$key.' AND '.'m.identifier = :identifier'.$key.')';
                    $qb->setParameter('package'.$key, $vendor . '/' . $project);
                    $qb->setParameter('identifier'.$key, $identifier);
                }

                $qb->andWhere(implode(' OR ', $moduleUriQuery));
            }

            if($params['fromNow']){
                foreach($params['fromNow'] as $fromNow) {
                    switch($fromNow){
                        case 'done':
                            $fromNowQuery[] = '(c.startDate < CURRENT_TIMESTAMP() AND c.endDate < CURRENT_TIMESTAMP())';
                            break;
                        case 'ongoing':
                            $fromNowQuery[] = '(c.startDate < CURRENT_TIMESTAMP() AND c.endDate > CURRENT_TIMESTAMP())';
                            break;
                        case 'upcoming':
                            $fromNowQuery[] = '(c.startDate > CURRENT_TIMESTAMP() AND c.endDate > CURRENT_TIMESTAMP())';
                            break;
                    }
                }

                $qb->andWhere(implode(' OR ', $fromNowQuery));
            }

            if($params['status']){
                foreach($params['status'] as $key => $status) {
                    $statusQuery[] = 'c.status = :status' . $key;
                    $qb->setParameter('status' . $key, $status);
                }

                $qb->andWhere(implode(' OR ', $statusQuery));
            }

            $qb->orderBy('c.name');
            $query = $qb->getQuery();


            return $this->response(
                $query->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY)
            );
        } catch (\Exception $e) {
            return $this->errorResponse($e->getMessage(), $e->getCode());
        }
    }