/**
  * @param ListingRequest $context
  * @param QueryBuilder $builder
  */
 private function addSortings(ListingRequest $context, QueryBuilder $builder)
 {
     foreach ($context->getSortings() as $sort) {
         if (!isset($sort['property'])) {
             continue;
         }
         $dir = 'ASC';
         if (isset($sort['direction'])) {
             $dir = $sort['direction'];
         }
         $builder->addOrderBy($sort['property'], $dir);
     }
 }
 /**
  * @param ListingRequest $context
  * @return ListingResultStruct
  * @throws \Exception
  */
 public function getListing(ListingRequest $context)
 {
     $params = ['locale' => $context->getLocale(), 'shopwareVersion' => $context->getShopwareVersion(), 'offset' => $context->getOffset(), 'limit' => $context->getLimit(), 'sort' => json_encode($context->getSortings()), 'filter' => json_encode($context->getConditions())];
     $data = $this->storeClient->doGetRequest('/pluginStore/plugins', $params);
     $plugins = $this->hydrator->hydrateStorePlugins($data['data']);
     return new ListingResultStruct($plugins, $data['total']);
 }