/**
  * {@inheritdoc}
  */
 public function apply(DatasourceInterface $datasource, $field, $direction)
 {
     $groupId = $this->requestParams->get('currentGroup', null);
     if (!$groupId) {
         throw new \LogicException('The current product group must be configured');
     }
     $field = 'in_group_' . $groupId;
     $datasource->getProductQueryBuilder()->addSorter($field, $direction);
 }
 /**
  * Constructor
  *
  * @param DatasourceInterface $datasource
  */
 public function __construct(DatasourceInterface $datasource)
 {
     $this->qb = $datasource->getQueryBuilder();
     $this->pqb = $datasource->getProductQueryBuilder();
     $this->expressionBuilder = null;
 }
 /**
  * {@inheritdoc}
  */
 public function apply(DatasourceInterface $datasource, $field, $direction)
 {
     $datasource->getProductQueryBuilder()->addSorter('is_associated', $direction);
 }
 /**
  * {@inheritdoc}
  */
 public function apply(DatasourceInterface $datasource, $field, $direction)
 {
     $datasource->getProductQueryBuilder()->addSorter('completeness', $direction);
 }