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


PHP SerializerInterface::implement方法代码示例

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


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

示例1: let

 function let(SerializerInterface $serializer, AttributeInterface $simpleAttribute)
 {
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
     $simpleAttribute->isLocalizable()->willReturn(false);
     $simpleAttribute->isScopable()->willReturn(false);
     $simpleAttribute->getCode()->willReturn('simple');
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:8,代码来源:ProductValueNormalizerSpec.php

示例2: let

 function let(SerializerInterface $serializer, AttributeInterface $simpleAttribute, LocalizerRegistryInterface $localizerRegistry)
 {
     $this->beConstructedWith($localizerRegistry, 4);
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
     $simpleAttribute->isLocalizable()->willReturn(false);
     $simpleAttribute->isScopable()->willReturn(false);
     $simpleAttribute->getCode()->willReturn('simple');
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:9,代码来源:ProductValueNormalizerSpec.php

示例3: 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

示例4: ProductPrice

 function it_normalizes_value_with_collection_data(SerializerInterface $serializer, ProductValueInterface $value, AbstractAttribute $attribute)
 {
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
     $attribute->getCode()->willReturn('code');
     $attribute->isLocalizable()->willReturn(false);
     $attribute->isScopable()->willReturn(false);
     $price = new ProductPrice();
     $price->setData(42);
     $price->setCurrency('EUR');
     $collection = new ArrayCollection([$price]);
     $value->getData()->willReturn($collection);
     $value->getAttribute()->willReturn($attribute);
     $serializer->normalize($price, 'mongodb_json', [])->willReturn(['data' => 42, 'currency' => 'EUR']);
     $this->normalize($value, 'mongodb_json', [])->shouldReturn(['code' => ['EUR' => ['data' => 42, 'currency' => 'EUR']]]);
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:16,代码来源:ProductValueNormalizerSpec.php

示例5: let

 function let(SerializerInterface $serializer, CollectionFilterInterface $filter)
 {
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->beConstructedWith($filter);
     $this->setSerializer($serializer);
 }
开发者ID:umpirsky,项目名称:pim-community-dev,代码行数:6,代码来源:ProductNormalizerSpec.php

示例6: let

 function let(SerializerInterface $serializer)
 {
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:5,代码来源:ProductValuesNormalizerSpec.php

示例7: let

 function let(SerializerInterface $serializer)
 {
     $this->beConstructedWith(['pim_catalog_multiselect']);
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface');
     $this->setSerializer($serializer);
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:6,代码来源:AttributeOptionsDenormalizerSpec.php

示例8: let

 function let(MongoObjectsFactory $mongoFactory, SerializerInterface $serializer)
 {
     $this->beConstructedWith($mongoFactory);
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:6,代码来源:ProductNormalizerSpec.php

示例9: let

 function let(SerializerInterface $serializer)
 {
     $this->beConstructedWith('Pim\\Bundle\\CatalogBundle\\Model\\ProductValue');
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface');
     $this->setSerializer($serializer);
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:6,代码来源:ProductValueDenormalizerSpec.php

示例10: let

 function let(SerializerInterface $serializer, NormalizerFilterInterface $filter)
 {
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
     $this->setFilters(array($filter));
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:6,代码来源:ProductNormalizerSpec.php

示例11: let

 function let(SerializerInterface $serializer, TranslatorInterface $translator)
 {
     $this->beConstructedWith($translator);
     $serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
     $this->setSerializer($serializer);
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:6,代码来源:JobExecutionNormalizerSpec.php


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