예제 #1
0
 /**
  * {@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', 'score' => 'FIELD(product.id, :scores)']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
 }
 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]));
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'coupon.id', 'name' => 'coupon_translation.name', 'code' => 'coupon.code', 'createdAt' => 'coupon.createdAt', 'validFrom' => 'coupon.validFrom', 'validTo' => 'coupon.validTo', 'discount' => 'IF_ELSE(coupon.modifierType = \'%\', CONCAT_WS(\'\', coupon.modifierValue, coupon.modifierType), CONCAT_WS(\' \', coupon.modifierValue, coupon.currency))']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']), 'validFrom' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d']), 'validTo' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d'])]);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'package.id', 'name' => 'package.name', 'fullName' => 'package.fullName', 'vendor' => 'package.vendor', 'localVersion' => 'package.localVersion', 'remoteVersion' => 'package.remoteVersion', 'createdAt' => 'package.createdAt', 'updatedAt' => 'package.updatedAt']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']), 'updatedAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']), 'localVersion' => $this->getDataSetTransformer('package_version_reference'), 'remoteVersion' => $this->getDataSetTransformer('package_version_reference')]);
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'media.id', 'name' => 'media.name', 'mime' => 'media.mime', 'extension' => 'media.extension', 'size' => 'media.size', 'preview' => 'media.path']);
     $configurator->setColumnTransformers(['preview' => $this->getDataSetTransformer('image_path', ['filter' => 'medium'])]);
 }
예제 #6
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'client.id', 'firstName' => 'client.contactDetails.firstName', 'lastName' => 'client.contactDetails.lastName', 'email' => 'client.contactDetails.email', 'phone' => 'client.contactDetails.phone', 'groupName' => 'client_group_translation.name', 'createdAt' => 'client.createdAt']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s'])]);
 }
예제 #7
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'review.id', 'nick' => 'review.nick', 'rating' => 'review.rating', 'createdAt' => 'review.createdAt', 'product' => 'product_translation.name']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s'])]);
 }
 /**
  * {@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', 'symbol' => 'product_status.symbol']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
     $configurator->setCacheOptions(new CacheOptions(true, 3600, [ProductStatus::class, ProductStatusTranslation::class]));
 }
 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]));
 }
예제 #10
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'company.id', 'name' => 'company.name', 'shortName' => 'company.shortName', 'createdAt' => 'company.createdAt']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s'])]);
 }
예제 #11
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'producer.id', 'name' => 'producer_translation.name', 'route' => 'IDENTITY(producer_translation.route)', 'products' => 'COUNT(producer_products.id)']);
     $configurator->setColumnTransformers(['route' => $this->getDataSetTransformer('route')]);
 }
예제 #12
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'order_status.id', 'name' => 'order_status_translation.name', 'createdAt' => 'order_status.createdAt', 'groupName' => 'order_status_group_translation.name']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s'])]);
 }
예제 #13
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'orders.id', 'client' => 'CONCAT_WS(\':\', orders.billingAddress.firstName, orders.billingAddress.lastName, orders.contactDetails.phone)', 'productTotal' => 'orders.productTotal.grossAmount', 'shippingTotal' => 'orders.shippingTotal.grossAmount', 'orderTotal' => 'orders.orderTotal.grossAmount', 'currentStatus' => 'status_translation.name', 'currency' => 'orders.currency', 'createdAt' => 'orders.createdAt']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']), 'client' => $this->getDataSetTransformer('order_client')]);
 }
 /**
  * {@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')]);
 }
예제 #15
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'channel.id', 'name' => 'channel.name', 'url' => 'channel.url', 'createdAt' => 'channel.createdAt', 'updatedAt' => 'channel.updatedAt']);
     $configurator->setColumnTransformers(['createdAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']), 'updatedAt' => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s'])]);
 }
예제 #16
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(DataSetConfiguratorInterface $configurator)
 {
     $configurator->setColumns(['id' => 'cart_product.id', 'price' => 'IF_ELSE(cart_product.attribute IS NOT NULL, product_attribute.sellPrice.grossAmount, product.sellPrice.grossAmount)', 'discountedPrice' => 'IF_ELSE(cart_product.attribute IS NOT NULL, product_attribute.sellPrice.discountedGrossAmount, product.sellPrice.discountedGrossAmount)', 'currency' => 'IF_ELSE(cart_product.attribute IS NOT NULL, product_attribute.sellPrice.currency, product.sellPrice.currency)', 'stock' => 'IF_ELSE(cart_product.attribute IS NOT NULL, product_attribute.stock, product.stock)', 'weight' => 'IF_ELSE(cart_product.attribute IS NOT NULL, product_attribute.weight, product.weight)', 'quantity' => 'cart_product.quantity', 'attribute' => 'IDENTITY(cart_product.attribute)', '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')]);
 }
예제 #17
0
 /**
  * {@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]));
 }