本文整理汇总了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');
}
示例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');
}
示例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]);
}
示例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']]]);
}
示例5: let
function let(SerializerInterface $serializer, CollectionFilterInterface $filter)
{
$serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
$this->beConstructedWith($filter);
$this->setSerializer($serializer);
}
示例6: let
function let(SerializerInterface $serializer)
{
$serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
$this->setSerializer($serializer);
}
示例7: let
function let(SerializerInterface $serializer)
{
$this->beConstructedWith(['pim_catalog_multiselect']);
$serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface');
$this->setSerializer($serializer);
}
示例8: let
function let(MongoObjectsFactory $mongoFactory, SerializerInterface $serializer)
{
$this->beConstructedWith($mongoFactory);
$serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
$this->setSerializer($serializer);
}
示例9: let
function let(SerializerInterface $serializer)
{
$this->beConstructedWith('Pim\\Bundle\\CatalogBundle\\Model\\ProductValue');
$serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface');
$this->setSerializer($serializer);
}
示例10: let
function let(SerializerInterface $serializer, NormalizerFilterInterface $filter)
{
$serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
$this->setSerializer($serializer);
$this->setFilters(array($filter));
}
示例11: let
function let(SerializerInterface $serializer, TranslatorInterface $translator)
{
$this->beConstructedWith($translator);
$serializer->implement('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface');
$this->setSerializer($serializer);
}