本文整理汇总了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]);
}
示例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;
}
示例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()));
}
示例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();
}
示例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'])];
}