DataSet/Front/ProductDataSet.php
public function configureOptions(DataSetConfiguratorInterface $configurator)
    {
        $configurator->setColumns([
            'id'                 => 'product.id',
            'sku'                => 'product.sku',
            'enabled'            => 'product.enabled',
            'name'               => 'product_translation.name',
            'shortDescription'   => 'product_translation.shortDescription',
            'description'        => 'product_translation.description',
            'route'              => 'IDENTITY(product_translation.route)',
            'weight'             => 'product.weight',
            'netPrice'           => 'product.sellPrice.netAmount',
            'price'              => 'product.sellPrice.grossAmount',
            'discountedPrice'    => 'product.sellPrice.discountedGrossAmount',
            'discountedNetPrice' => 'product.sellPrice.discountedNetAmount',
            'isDiscountValid'    => 'IF_ELSE(:date BETWEEN IF_NULL(product.sellPrice.validFrom, :date) AND IF_NULL(product.sellPrice.validTo, :date) AND product.sellPrice.discountedGrossAmount > 0, 1, 0)',
            'finalPrice'         => 'IF_ELSE(:date BETWEEN IF_NULL(product.sellPrice.validFrom, :date) AND IF_NULL(product.sellPrice.validTo, :date) AND product.sellPrice.discountedGrossAmount > 0, product.sellPrice.discountedGrossAmount, product.sellPrice.grossAmount) * currency_rate.exchangeRate',
            'currency'           => 'product.sellPrice.currency',
            'tax'                => 'sell_tax.value',
            'stock'              => 'product.stock',
            'producerId'         => 'IDENTITY(product.producer)',
            'producerName'       => 'producers_translation.name',
            'category'           => 'categories.id',
            'filteredCategory'   => 'filtered_categories.id',
            'categoryName'       => 'categories_translation.name',
            'categoryRoute'      => 'IDENTITY(categories_translation.route)',
            'shop'               => 'product_shops.id',
            'photo'              => 'photos.path',
            'status'             => 'IDENTITY(distinction.status)',
            'variantOption'      => 'IDENTITY(variant_option.attributeValue)',
            'distinctions'       => 'product.id',
            'hierarchy'          => 'product.hierarchy',
            'isStatusValid'      => 'IF_ELSE(:date BETWEEN IF_NULL(distinction.validFrom, :date) AND IF_NULL(distinction.validTo, :date), 1, 0)',
        ]);
        
        $configurator->setColumnTransformers([
            'route'         => $this->manager->createTransformer('route'),
            'categoryRoute' => $this->manager->createTransformer('route'),
            'distinctions'  => $this->manager->createTransformer('distinctions'),
        ]);
        
        $configurator->setCacheOptions(new CacheOptions(true, 3600, [
            Product::class,
            ProductTranslation::class,
            Producer::class,
            ProducerTranslation::class,
            Category::class,
        ]));
    }
public function configureOptions(DataSetConfiguratorInterface $configurator)
    {
        $configurator->setColumns([
            'id'                 => 'product.id',
            'sku'                => 'product.sku',
            'enabled'            => 'product.enabled',
            'name'               => 'product_translation.name',
            'shortDescription'   => 'product_translation.shortDescription',
            'description'        => 'product_translation.description',
            'route'              => 'IDENTITY(product_translation.route)',
            'weight'             => 'product.weight',
            'netPrice'           => 'product.sellPrice.netAmount',
            'price'              => 'product.sellPrice.grossAmount',
            'discountedPrice'    => 'product.sellPrice.discountedGrossAmount',
            'discountedNetPrice' => 'product.sellPrice.discountedNetAmount',
            'isDiscountValid'    => 'IF_ELSE(:date BETWEEN IF_NULL(product.sellPrice.validFrom, :date) AND IF_NULL(product.sellPrice.validTo, :date) AND product.sellPrice.discountedGrossAmount > 0, 1, 0)',
            'finalPrice'         => 'IF_ELSE(:date BETWEEN IF_NULL(product.sellPrice.validFrom, :date) AND IF_NULL(product.sellPrice.validTo, :date) AND product.sellPrice.discountedGrossAmount > 0, product.sellPrice.discountedGrossAmount, product.sellPrice.grossAmount) * currency_rate.exchangeRate',
            'currency'           => 'product.sellPrice.currency',
            'tax'                => 'sell_tax.value',
            'stock'              => 'product.stock',
            'producerId'         => 'IDENTITY(product.producer)',
            'producerName'       => 'producers_translation.name',
            'category'           => 'categories.id',
            'filteredCategory'   => 'filtered_categories.id',
            'categoryName'       => 'categories_translation.name',
            'categoryRoute'      => 'IDENTITY(categories_translation.route)',
            'shop'               => 'product_shops.id',
            'photo'              => 'photos.path',
            'status'             => 'IDENTITY(distinction.status)',
            'variantOption'      => 'IDENTITY(variant_option.attributeValue)',
            'distinctions'       => 'product.id',
            'hierarchy'          => 'product.hierarchy',
            'isStatusValid'      => 'IF_ELSE(:date BETWEEN IF_NULL(distinction.validFrom, :date) AND IF_NULL(distinction.validTo, :date), 1, 0)',
        ]);
        
        $configurator->setColumnTransformers([
            'route'         => $this->manager->createTransformer('route'),
            'categoryRoute' => $this->manager->createTransformer('route'),
            'distinctions'  => $this->manager->createTransformer('distinctions'),
        ]);
        
        $configurator->setCacheOptions(new CacheOptions(true, 3600, [
            Product::class,
            ProductTranslation::class,
            Producer::class,
            ProducerTranslation::class,
            Category::class,
        ]));
    }
public function configureOptions ( DataSetConfiguratorInterface $ configurator ) { $ configurator -> setColumns ( [ 'id' => 'product.id' , 'sku' => 'product.sku' , 'enabled' => 'product.enabled' , 'name' => 'product_translation.name' , 'shortDescription' => 'product_translation.shortDescription' , 'description' => 'product_translation.description' , 'route' => 'IDENTITY(product_translation.route)' , 'weight' => 'product.weight' , 'netPrice' => 'product.sellPrice.netAmount' , 'price' => 'product.sellPrice.grossAmount' , 'discountedPrice' => 'product.sellPrice.discountedGrossAmount' , 'discountedNetPrice' => 'product.sellPrice.discountedNetAmount' , 'isDiscountValid' => 'IF_ELSE(:date BETWEEN IF_NULL(product.sellPrice.validFrom, :date) AND IF_NULL(product.sellPrice.validTo, :date) AND product.sellPrice.discountedGrossAmount > 0, 1, 0)' , 'finalPrice' => 'IF_ELSE(:date BETWEEN IF_NULL(product.sellPrice.validFrom, :date) AND IF_NULL(product.sellPrice.validTo, :date) AND product.sellPrice.discountedGrossAmount > 0, product.sellPrice.discountedGrossAmount, product.sellPrice.grossAmount) * currency_rate.exchangeRate' , 'currency' => 'product.sellPrice.currency' , 'tax' => 'sell_tax.value' , 'stock' => 'product.stock' , 'producerId' => 'IDENTITY(product.producer)' , 'producerName' => 'producers_translation.name' , 'category' => 'categories.id' , 'filteredCategory' => 'filtered_categories.id' , 'categoryName' => 'categories_translation.name' , 'categoryRoute' => 'IDENTITY(categories_translation.route)' , 'shop' => 'product_shops.id' , 'photo' => 'photos.path' , 'status' => 'IDENTITY(distinction.status)' , 'variantOption' => 'IDENTITY(variant_option.attributeValue)' , 'distinctions' => 'product.id' , 'hierarchy' => 'product.hierarchy' , 'isStatusValid' => 'IF_ELSE(:date BETWEEN IF_NULL(distinction.validFrom, :date) AND IF_NULL(distinction.validTo, :date), 1, 0)' , ] ) ; $ configurator -> setColumnTransformers ( [ 'route' => $ this -> manager -> createTransformer ( 'route' ) , 'categoryRoute' => $ this -> manager -> createTransformer ( 'route' ) , 'distinctions' => $ this -> manager -> createTransformer ( 'distinctions' ) , ] ) ; $ configurator -> setCacheOptions ( new CacheOptions ( true , 3600 , [ Product :: class , ProductTranslation :: class , Producer :: class , ProducerTranslation :: class , Category :: class , ] ) ) ; }
{@inheritdoc}
{