<?php | |
// .. | |
use Symfony\Component\Serializer\Annotation\Groups; | |
/** | |
* @ApiResource( | |
* normalizationContext={"groups"={"flashcardList"}}, | |
* denormalizationContext={"groups"={"flashcardCreate"}} | |
* ) | |
* ... | |
*/ | |
class Flashcard | |
{ | |
/** | |
* ... | |
* @Groups({"flashcardList"}) | |
*/ | |
private $id; | |
/** | |
* ... | |
* @Groups({"flashcardList", "flashcardCreate"}) | |
*/ | |
public $question; | |
/** | |
* ... | |
* @Groups({"flashcardList", "flashcardCreate"}) | |
*/ | |
public $answer; | |
/** | |
* ... | |
* @Groups({"flashcardCreate"}) | |
*/ | |
public $lesson; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment