Skip to content

Instantly share code, notes, and snippets.

@piotrbrzezina
Created September 14, 2018 11:16
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/7b06f9f39c0af93b80b223b8d4c6dd60 to your computer and use it in GitHub Desktop.
Save piotrbrzezina/7b06f9f39c0af93b80b223b8d4c6dd60 to your computer and use it in GitHub Desktop.
Flashcard setp 5 (custom Opperation)
<?php
// ...
/**
* @ApiResource(
* normalizationContext={"groups"={"userList"}},
* denormalizationContext={"groups"={"userCreate"}},
* validationGroups="userCreate",
* itemOperations={
* "get",
* "put",
* "changePassword"={
* "method"="PUT",
* "path"="/users/{id}/change-password",
* "denormalization_context"={"groups"={"userChangePassword"}},
* "validation_groups"={"userChangePassword"},
* "swagger_context"={
* "summary" = "Change user password"
* }
* }
* }
* )
*/
class User implements UserInterface
{
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment