Created
December 12, 2018 13:38
-
-
Save tsh-code/6776dfd14ee94912e9da820d83a6b007 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"={"lessonList"}}, | |
* denormalizationContext={"groups"={"lessonCreate"}} | |
* ) | |
* ... | |
*/ | |
class Lesson | |
{ | |
/** | |
* ... | |
* @Groups({"lessonList"}) | |
*/ | |
private $id; | |
/** | |
* ... | |
* @Groups({"lessonList", "lessonCreate"}) | |
*/ | |
public $name; | |
/** | |
* ... | |
* @Groups({"lessonCreate"}) | |
*/ | |
public $subject; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment