p-basymfony-serializer-ext

此包扩展了标准 Symfony Serializer 功能

dev-master 2019-11-23 20:00 UTC

This package is auto-updated.

Last update: 2024-09-24 07:22:13 UTC


README

Build Status

为标准的 symfony/seriazlier 组件提供额外功能

//Input data
$json = '{"testProperty": "testValue"}';

class SomeClass {
  /**
   * @PBA\Serializer\Annotation\DeserializedName(name="testProperty")
   */
  public $property;
}

$someClassInstance = $serializer->deserealize($json, SomeClass::class, 'json');

echo $someClassInstance->property; //echoes 'testValue'