Skip to content

Instantly share code, notes, and snippets.

@tamert
Last active August 29, 2020 20:49
Show Gist options
  • Save tamert/faab2c51b0fd839738b3fe48aaed8f2d to your computer and use it in GitHub Desktop.
Save tamert/faab2c51b0fd839738b3fe48aaed8f2d to your computer and use it in GitHub Desktop.
News.php
<?php
// src/Entity/News.php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource
*/
class News
{
/**
* @ORM\Column(type="string", length=255, nullable=false)
* @Groups({
* "news.list",
* "news.detail",
* "news.create"
* })
*/
private $status;
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment