当前位置: 首页>>代码示例>>PHP>>正文


PHP DataSetConfiguratorInterface::setCacheOptions方法代码示例

本文整理汇总了PHP中WellCommerce\Component\DataSet\Configurator\DataSetConfiguratorInterface::setCacheOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP DataSetConfiguratorInterface::setCacheOptions方法的具体用法?PHP DataSetConfiguratorInterface::setCacheOptions怎么用?PHP DataSetConfiguratorInterface::setCacheOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WellCommerce\Component\DataSet\Configurator\DataSetConfiguratorInterface的用法示例。


在下文中一共展示了DataSetConfiguratorInterface::setCacheOptions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configureOptions

 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'currency.id', 'code' => 'currency.code']);
     $this->setDefaultRequestOption('order_by', 'code');
     $configurator->setCacheOptions(new CacheOptions(true, 3600, [Currency::class]));
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:6,代码来源:CurrencyDataSet.php

示例2: configureOptions

 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'order_product.id', 'price' => 'IF_ELSE(order_product.variant IS NOT NULL, product_variant.sellPrice.grossAmount, product.sellPrice.grossAmount)', 'discountedPrice' => 'IF_ELSE(order_product.variant IS NOT NULL, product_variant.sellPrice.discountedGrossAmount, product.sellPrice.discountedGrossAmount)', 'currency' => 'IF_ELSE(order_product.variant IS NOT NULL, product_variant.sellPrice.currency, product.sellPrice.currency)', 'stock' => 'IF_ELSE(order_product.variant IS NOT NULL, product_variant.stock, product.stock)', 'weight' => 'IF_ELSE(order_product.variant IS NOT NULL, product_variant.weight, product.weight)', 'quantity' => 'order_product.quantity', 'variant' => 'IDENTITY(order_product.variant)', 'options' => 'order_product.options', 'name' => 'product_translation.name', 'route' => 'IDENTITY(product_translation.route)', 'isDiscountValid' => 'IF_ELSE(:date BETWEEN product.sellPrice.validFrom AND product.sellPrice.validTo, 1, 0)', 'tax' => 'sell_tax.value', 'photo' => 'photos.path']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
     $configurator->setCacheOptions(new CacheOptions(true, 3600, [Order::class, OrderProduct::class, Product::class, Variant::class, Tax::class]));
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:6,代码来源:OrderProductDataSet.php

示例3: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'product.id', 'name' => 'product_translation.name', 'shortDescription' => 'product_translation.shortDescription', 'description' => 'product_translation.description', 'route' => 'IDENTITY(product_translation.route)', 'weight' => 'product.weight', 'price' => 'product.sellPrice.grossAmount', 'discountedPrice' => 'product.sellPrice.discountedGrossAmount', 'isDiscountValid' => 'IF_ELSE(:date BETWEEN product.sellPrice.validFrom AND product.sellPrice.validTo, 1, 0)', 'finalPrice' => 'IF_ELSE(:date BETWEEN product.sellPrice.validFrom AND product.sellPrice.validTo, 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', 'shop' => 'product_shops.id', 'photo' => 'photos.path', 'status' => 'statuses.id']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
     $configurator->setCacheOptions(new CacheOptions(true, 3600, [Product::class, ProductTranslation::class, Producer::class, ProducerTranslation::class, Category::class]));
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:9,代码来源:ProductDataSet.php

示例4: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'product_status.id', 'name' => 'product_status_translation.name', 'route' => 'IDENTITY(product_status_translation.route)', 'css_class' => 'product_status_translation.cssClass']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
     $configurator->setCacheOptions(new CacheOptions(true, 3600, [ProductStatus::class, ProductStatusTranslation::class]));
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:9,代码来源:ProductStatusDataSet.php

示例5: configureOptions

 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'category.id', 'hierarchy' => 'category.hierarchy', 'enabled' => 'category.enabled', 'parent' => 'IDENTITY(category.parent)', 'children_count' => 'category.childrenCount', 'products_count' => 'category.productsCount', 'name' => 'category_translation.name', 'slug' => 'category_translation.slug', 'shop' => 'category_shops.id', 'route' => 'IDENTITY(category_translation.route)']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
     $configurator->setCacheOptions(new CacheOptions(true, 3600, [Category::class, CategoryInterface::class, CategoryTranslation::class]));
 }
开发者ID:WellCommerce,项目名称:CategoryBundle,代码行数:6,代码来源:CategoryDataSet.php

示例6: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'producer.id', 'name' => 'producer_translation.name', 'route' => 'IDENTITY(producer_translation.route)', 'shop' => 'producer_shops.id', 'products' => 'COUNT(producer_products.id)']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
     $configurator->setCacheOptions(new CacheOptions(true, 3600, [Product::class, Producer::class, ProducerTranslation::class]));
 }
开发者ID:wellcommerce,项目名称:wellcommerce,代码行数:9,代码来源:ProducerDataSet.php


注:本文中的WellCommerce\Component\DataSet\Configurator\DataSetConfiguratorInterface::setCacheOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。