/**
  * This listener is applicable for marketing list grids that has emailCampaign parameter set.
  *
  * @param string $gridName
  * @param ParameterBag $parameterBag
  *
  * @return bool
  */
 public function isApplicable($gridName, ParameterBag $parameterBag)
 {
     if (!$parameterBag->has('emailCampaign')) {
         return false;
     }
     return (bool) $this->marketingListHelper->getMarketingListIdByGridName($gridName);
 }
 /**
  * @param ParameterBag $parameters
  */
 public function setParameters(ParameterBag $parameters)
 {
     if ($parameters->has(ParameterBag::MINIFIED_PARAMETERS)) {
         $minifiedParameters = $parameters->get(ParameterBag::MINIFIED_PARAMETERS);
         $additional = $parameters->get(ParameterBag::ADDITIONAL_PARAMETERS, []);
         if (array_key_exists(self::MINIFIED_VIEWS_PARAM_KEY, $minifiedParameters)) {
             $additional[self::VIEWS_PARAM_KEY] = $minifiedParameters[self::MINIFIED_VIEWS_PARAM_KEY];
         }
         $parameters->set(ParameterBag::ADDITIONAL_PARAMETERS, $additional);
     }
     parent::setParameters($parameters);
 }
Example #3
0
 /**
  * @param ParameterBag $parameters
  */
 public function setParameters(ParameterBag $parameters)
 {
     if ($parameters->has(ParameterBag::MINIFIED_PARAMETERS)) {
         $minifiedParameters = $parameters->get(ParameterBag::MINIFIED_PARAMETERS);
         $sorters = [];
         if (array_key_exists(self::MINIFIED_SORTERS_PARAM, $minifiedParameters)) {
             $sorters = $minifiedParameters[self::MINIFIED_SORTERS_PARAM];
             if (is_array($sorters)) {
                 foreach ($sorters as $field => $direction) {
                     $sorters[$field] = $direction > 0 ? self::DIRECTION_DESC : self::DIRECTION_ASC;
                 }
             }
         }
         $parameters->set(self::SORTERS_ROOT_PARAM, $sorters);
     }
     parent::setParameters($parameters);
 }
 /**
  * Set columns params data from minified params
  *
  * @param ParameterBag $parameters
  */
 public function setParameters(ParameterBag $parameters)
 {
     if ($parameters->has(ParameterBag::MINIFIED_PARAMETERS)) {
         $minifiedParameters = $parameters->get(ParameterBag::MINIFIED_PARAMETERS);
         $columns = '';
         if (array_key_exists(self::MINIFIED_COLUMNS_PARAM, $minifiedParameters)) {
             $columns = $minifiedParameters[self::MINIFIED_COLUMNS_PARAM];
         }
         $parameters->set(self::MINIFIED_COLUMNS_PARAM, $columns);
     }
     parent::setParameters($parameters);
 }
Example #5
0
 /**
  * @param ParameterBag $parameters
  */
 public function setParameters(ParameterBag $parameters)
 {
     if ($parameters->has(ParameterBag::MINIFIED_PARAMETERS)) {
         $minifiedParameters = $parameters->get(ParameterBag::MINIFIED_PARAMETERS);
         $filters = [];
         if (array_key_exists(self::MINIFIED_FILTER_PARAM, $minifiedParameters)) {
             $filters = $minifiedParameters[self::MINIFIED_FILTER_PARAM];
         }
         $parameters->set(self::FILTER_ROOT_PARAM, $filters);
     }
     parent::setParameters($parameters);
 }
Example #6
0
 /**
  * @param ParameterBag $parameters
  */
 public function setParameters(ParameterBag $parameters)
 {
     if ($parameters->has(ParameterBag::MINIFIED_PARAMETERS)) {
         $minifiedParameters = $parameters->get(ParameterBag::MINIFIED_PARAMETERS);
         $pager = [];
         if (array_key_exists(PagerInterface::MINIFIED_PAGE_PARAM, $minifiedParameters)) {
             $pager[PagerInterface::PAGE_PARAM] = $minifiedParameters[PagerInterface::MINIFIED_PAGE_PARAM];
         }
         if (array_key_exists(PagerInterface::MINIFIED_PER_PAGE_PARAM, $minifiedParameters)) {
             $pager[PagerInterface::PER_PAGE_PARAM] = $minifiedParameters[PagerInterface::MINIFIED_PER_PAGE_PARAM];
         }
         $parameters->set(PagerInterface::PAGER_ROOT_PARAM, $pager);
     }
     parent::setParameters($parameters);
 }