Skip to content

Instantly share code, notes, and snippets.

@piotrbrzezina
Last active September 14, 2018 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotrbrzezina/ceffca06d59ce9a75b0360c21850653f to your computer and use it in GitHub Desktop.
Save piotrbrzezina/ceffca06d59ce9a75b0360c21850653f to your computer and use it in GitHub Desktop.
Flashcard step 3 (serialization groups)
<?php
// ...
use Symfony\Component\Serializer\Annotation\Groups;
class Subject
{
/**
* ...
* @Groups({"subjectList"})
*/
private $id;
/**
* ...
* @Groups({"subjectList", "subjectCreate"})
*/
public $name;
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment