src/Entity/ConferenceCredit.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use App\Repository\ConferenceCreditRepository;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. /**
  8.  * @ApiResource(
  9.  *      attributes={"security"="is_granted('ROLE_SUPER_ADMIN')"},
  10.  *      normalizationContext={"groups"={"ConferenceCredit:Read"}, "skip_null_values"=false},
  11.  *      denormalizationContext={"groups"={"ConferenceCredit:Write"}},
  12.  *      collectionOperations={
  13.  *          "post",
  14.  *          "get"
  15.  *      },
  16.  *      itemOperations={
  17.  *          "get"
  18.  *     }
  19.  * )
  20.  * @ORM\Entity(repositoryClass=ConferenceCreditRepository::class)
  21.  */
  22. class ConferenceCredit
  23. {
  24.     /**
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue
  27.      * @ORM\Column(type="integer")
  28.      * @Groups({"Conference:Read", "Conference:PRead"})
  29.      */
  30.     private $id;
  31.     /**
  32.      * @ORM\Column(type="decimal", precision=5, scale=2)
  33.      * @Groups({"Conference:Read", "Conference:Write", "Conference:PRead"})
  34.      */
  35.     private $creditPoint;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=Conference::class, inversedBy="conferenceCredits")
  38.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  39.      */
  40.     private $conference;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=CreditCategory::class)
  43.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  44.      * @Groups({"Conference:Read", "Conference:Write", "Conference:PRead"})
  45.      */
  46.     private $creditCategory;
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getCreditPoint(): ?string
  52.     {
  53.         return $this->creditPoint;
  54.     }
  55.     public function setCreditPoint(string $creditPoint): self
  56.     {
  57.         $this->creditPoint $creditPoint;
  58.         return $this;
  59.     }
  60.     public function getConference(): ?Conference
  61.     {
  62.         return $this->conference;
  63.     }
  64.     public function setConference(?Conference $conference): self
  65.     {
  66.         $this->conference $conference;
  67.         return $this;
  68.     }
  69.     public function getCreditCategory(): ?CreditCategory
  70.     {
  71.         return $this->creditCategory;
  72.     }
  73.     public function setCreditCategory(?CreditCategory $creditCategory): self
  74.     {
  75.         $this->creditCategory $creditCategory;
  76.         return $this;
  77.     }
  78. }