Created
December 12, 2018 13:39
-
-
Save tsh-code/dd02b2d411c0d926c1588196a798827a to your computer and use it in GitHub Desktop.
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 Symfony\Component\Serializer\Annotation\Groups; | |
/** | |
* @ApiResource( | |
* normalizationContext={"groups"={"userList"}}, | |
* denormalizationContext={"groups"={"userCreate"}} | |
* ) | |
* ... | |
*/ | |
class User implements UserInterface | |
{ | |
/** | |
* ... | |
* @Groups({"userList"}) | |
*/ | |
private $id; | |
/** | |
* ... | |
* @Groups({"userList", "userCreate"}) | |
*/ | |
public $name; | |
/** | |
* ... | |
* @Groups({"userCreate"}) | |
*/ | |
public $plainPassword; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment