Last active
November 27, 2020 14:22
-
-
Save merltron-pa/8293d52befb9b6a5396afa77b6d61ef3 to your computer and use it in GitHub Desktop.
PHP/JMS Article: Expose and configure types for entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
use JMS\Serializer\Annotation as Serializer; | |
/** | |
* @Serializer\ExclusionPolicy("all") | |
*/ | |
class Address | |
{ | |
/** | |
* @Serializer\Expose() | |
* @Serializer\Type("string") | |
* | |
* @var string|null | |
*/ | |
private $name; | |
/** | |
* @Serializer\Expose() | |
* @Serializer\Type("string") | |
* @Serializer\SerializedName("line1") | |
* | |
* @var string|null | |
*/ | |
private $lineOne; | |
... | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment