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


PHP ProductInterface::getUpdated方法代码示例

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


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

示例1: array

 function it_normalizes_product(SerializerInterface $serializer, ProductInterface $product, FamilyInterface $family, Completeness $completeness)
 {
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
     $product->getFamily()->willReturn($family);
     $product->getGroups()->willReturn([]);
     $product->getValues()->willReturn([]);
     $product->getCompletenesses()->willReturn([$completeness]);
     $product->getCreated()->willReturn(null);
     $product->getUpdated()->willReturn(null);
     $product->isEnabled()->willReturn(true);
     $serializer->normalize($family, 'mongodb_json', [])->willReturn('family normalization');
     $serializer->normalize($completeness, 'mongodb_json', [])->willReturn(['completenessCode' => 'completeness normalization']);
     $this->normalize($product, 'mongodb_json', [])->shouldReturn([ProductNormalizer::FAMILY_FIELD => 'family normalization', ProductNormalizer::COMPLETENESSES_FIELD => array('completenessCode' => 'completeness normalization'), ProductNormalizer::ENABLED_FIELD => true]);
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:15,代码来源:ProductNormalizerSpec.php

示例2: getDefaultDrupalProduct

 /**
  * @param  $product
  * @return array
  */
 public function getDefaultDrupalProduct(ProductInterface $product)
 {
     $labels = [];
     $attributeAsLabel = $product->getFamily()->getAttributeAsLabel();
     $availableLocales = $attributeAsLabel->getAvailableLocales();
     if (!is_null($availableLocales)) {
         foreach ($availableLocales as $availableLocale) {
             $labels[$availableLocale->getCode()] = $product->getLabel($availableLocale->getCode());
         }
     }
     // TODO: fix availableLocales doesn t must be NULL
     foreach ($attributeAsLabel->getTranslations() as $translation) {
         $labels[$translation->getLocale()] = $product->getLabel($translation->getLocale());
     }
     $defaultDrupalProduct = ['sku' => $product->getReference(), 'family' => $product->getFamily()->getCode(), 'created' => $product->getCreated()->format('c'), 'updated' => $product->getUpdated()->format('c'), 'status' => $product->isEnabled(), 'labels' => $labels, 'categories' => [], 'groups' => [], 'associations' => [], 'values' => []];
     return $defaultDrupalProduct;
 }
开发者ID:antoineguigan,项目名称:DrupalCommerceConnectorBundle,代码行数:21,代码来源:ProductNormalizer.php

示例3: theProductUpdatedDateShouldNotBeCloseTo

 /**
  * Asserts that we have more than a minute interval between the product updated date and the argument
  *
  * @Then /^the (product "([^"]+)") updated date should not be close to "([^"]+)"$/
  */
 public function theProductUpdatedDateShouldNotBeCloseTo(ProductInterface $product, $identifier, $expected)
 {
     assertGreaterThan(60, abs(strtotime($expected) - $product->getUpdated()->getTimestamp()));
 }
开发者ID:bengrol,项目名称:pim-community-dev,代码行数:9,代码来源:FixturesContext.php

示例4: needsUpdate

 /**
  * @param ProductInterface $product
  *
  * @return bool
  */
 protected function needsUpdate(ProductInterface $product)
 {
     $delta = $this->deltaRepository->findOneBy(['productId' => $product->getId(), 'jobInstance' => $this->stepExecution->getJobExecution()->getJobInstance()]);
     return null === $delta || $delta->getLastExport() < $product->getUpdated();
 }
开发者ID:mejdoubimeriem,项目名称:prestashopconnector,代码行数:10,代码来源:DeltaProductReader.php

示例5: getCustomValue

 /**
  * Get custom values (not provided by the PIM product)
  * @param ProductInterface  $product
  * @param MappingCollection $attributeCodeMapping
  * @param array             $parameters
  *
  * @return mixed
  */
 protected function getCustomValue(ProductInterface $product, MappingCollection $attributeCodeMapping, array $parameters = [])
 {
     return [strtolower($attributeCodeMapping->getTarget(self::VISIBILITY)) => $this->visibility, strtolower($attributeCodeMapping->getTarget(self::ENABLED)) => (string) $this->enabled ? 1 : 2, strtolower($attributeCodeMapping->getTarget('created_at')) => $product->getCreated()->format(AbstractNormalizer::DATE_FORMAT), strtolower($attributeCodeMapping->getTarget('updated_at')) => $product->getUpdated()->format(AbstractNormalizer::DATE_FORMAT), strtolower($attributeCodeMapping->getTarget('categories')) => $this->getProductCategories($product, $parameters['categoryMapping'], $parameters['scopeCode'])];
 }
开发者ID:jarocks,项目名称:MagentoConnectorBundle,代码行数:12,代码来源:ProductNormalizer.php


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