當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。