src/Entity/Source.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\SuperClass\BaseEntity;
  4. use App\Repository\SourceRepository;
  5. use App\Validator\IsValidOwner;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=SourceRepository::class)
  9. */
  10. class Source extends BaseEntity
  11. {
  12. /**
  13. * @ORM\Column(type="string", length=255)
  14. */
  15. private $source_id;
  16. /**
  17. * @ORM\Column(type="json")
  18. */
  19. private $response = [];
  20. /**
  21. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="sources")
  22. * @ORM\JoinColumn(nullable=false)
  23. * @IsValidOwner()
  24. */
  25. private $owner;
  26. public function getSourceId(): ?string
  27. {
  28. return $this->source_id;
  29. }
  30. public function setSourceId(string $source_id): self
  31. {
  32. $this->source_id = $source_id;
  33. return $this;
  34. }
  35. public function getResponse(): ?array
  36. {
  37. return $this->response;
  38. }
  39. public function setResponse(array $response): self
  40. {
  41. $this->response = $response;
  42. return $this;
  43. }
  44. public function getOwner(): ?User
  45. {
  46. return $this->owner;
  47. }
  48. public function setOwner(?User $owner): self
  49. {
  50. $this->owner = $owner;
  51. return $this;
  52. }
  53. }