src/Entity/Contacts.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\ContactsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use ApiPlatform\Metadata\ApiFilter;
  9. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  10. #[ORM\Entity(repositoryClassContactsRepository::class)]
  11. #[ApiResource(
  12.     normalizationContext: ['groups' => ['contacts:read']],
  13.     denormalizationContext: ['groups' => ['contacts:write']],
  14.     order: ['id' => 'DESC'],
  15. )]
  16. #[ApiFilter(SearchFilter::class, properties: [
  17.     'account.id' => 'exact'
  18.     'type' => 'exact'
  19.     'typeList' => 'exact'
  20. ])]
  21. class Contacts
  22. {
  23.     #[Groups(['account:read''contacts:read''contacts:write'])]
  24.     #[ORM\Id]
  25.     #[ORM\GeneratedValue]
  26.     #[ORM\Column]
  27.     private ?int $id null;
  28.     #[Groups(['account:read''contacts:read''contacts:write'])]
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $name null;
  31.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  32.     private ?\DateTimeInterface $date_entered null;
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  34.     private ?\DateTimeInterface $date_modified null;
  35.     #[ORM\ManyToOne]
  36.     private ?User $created_by null;
  37.     #[ORM\ManyToOne]
  38.     private ?User $modified_user null;
  39.     #[Groups(['contacts:read''contacts:write'])]
  40.     #[ORM\ManyToOne(inversedBy'contacts')]
  41.     private ?Accounts $account null;
  42.     #[Groups(['account:read''contacts:read''contacts:write'])]
  43.     #[ORM\Column(length20nullabletrue)]
  44.     private ?string $phone null;
  45.     #[Groups(['account:read''contacts:read''contacts:write'])]
  46.     #[ORM\Column(length100nullabletrue)]
  47.     private ?string $email null;
  48.     #[Groups(['account:read''contacts:read''contacts:write'])]
  49.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  50.     private ?string $description null;
  51.     #[Groups(['account:read''contacts:read''contacts:write'])]
  52.     #[ORM\Column(length255nullabletrue)]
  53.     private ?string $value null;
  54.     #[Groups(['account:read''contacts:read''contacts:write'])]
  55.     #[ORM\Column(length100nullabletrue)]
  56.     private ?string $country null;
  57.     #[Groups(['account:read''contacts:read''contacts:write'])]
  58.     #[ORM\Column(length100nullabletrue)]
  59.     private ?string $region null;
  60.     #[Groups(['account:read''contacts:read''contacts:write'])]
  61.     #[ORM\Column(length100nullabletrue)]
  62.     private ?string $city null;
  63.     #[Groups(['account:read''contacts:read''contacts:write'])]
  64.     #[ORM\Column(length100nullabletrue)]
  65.     private ?string $address null;
  66.     #[Groups(['account:read''contacts:read''contacts:write'])]
  67.     #[ORM\Column(length20)]
  68.     private ?string $code1c null;
  69.     #[Groups(['account:read''contacts:read''contacts:write'])]
  70.     #[ORM\Column(length100nullabletrue)]
  71.     private ?string $type null;
  72.     #[Groups(['account:read''contacts:read''contacts:write'])]
  73.     #[ORM\Column(length100nullabletrue)]
  74.     private ?string $typeList null;
  75.     public function getId(): ?int
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getName(): ?string
  80.     {
  81.         return $this->name;
  82.     }
  83.     public function setName(?string $name): self
  84.     {
  85.         $this->name $name;
  86.         return $this;
  87.     }
  88.     public function getDateEntered(): ?\DateTimeInterface
  89.     {
  90.         return $this->date_entered;
  91.     }
  92.     public function setDateEntered(?\DateTimeInterface $date_entered): self
  93.     {
  94.         $this->date_entered $date_entered;
  95.         return $this;
  96.     }
  97.     public function getDateModified(): ?\DateTimeInterface
  98.     {
  99.         return $this->date_modified;
  100.     }
  101.     public function setDateModified(?\DateTimeInterface $date_modified): self
  102.     {
  103.         $this->date_modified $date_modified;
  104.         return $this;
  105.     }
  106.     public function getCreatedBy(): ?User
  107.     {
  108.         return $this->created_by;
  109.     }
  110.     public function setCreatedBy(?User $created_by): self
  111.     {
  112.         $this->created_by $created_by;
  113.         return $this;
  114.     }
  115.     public function getModifiedUser(): ?User
  116.     {
  117.         return $this->modified_user;
  118.     }
  119.     public function setModifiedUser(?User $modified_user): self
  120.     {
  121.         $this->modified_user $modified_user;
  122.         return $this;
  123.     }
  124.     public function getAccount(): ?Accounts
  125.     {
  126.         return $this->account;
  127.     }
  128.     public function setAccount(?Accounts $account): self
  129.     {
  130.         $this->account $account;
  131.         return $this;
  132.     }
  133.     public function getPhone(): ?string
  134.     {
  135.         return $this->phone;
  136.     }
  137.     public function setPhone(?string $phone): self
  138.     {
  139.         $this->phone $phone;
  140.         return $this;
  141.     }
  142.     public function getEmail(): ?string
  143.     {
  144.         return $this->email;
  145.     }
  146.     public function setEmail(?string $email): self
  147.     {
  148.         $this->email $email;
  149.         return $this;
  150.     }
  151.     public function getDescription(): ?string
  152.     {
  153.         return $this->description;
  154.     }
  155.     public function setDescription(?string $description): self
  156.     {
  157.         $this->description $description;
  158.         return $this;
  159.     }
  160.     public function getValue(): ?string
  161.     {
  162.         return $this->value;
  163.     }
  164.     public function setValue(?string $value): self
  165.     {
  166.         $this->value $value;
  167.         return $this;
  168.     }
  169.     public function getCountry(): ?string
  170.     {
  171.         return $this->country;
  172.     }
  173.     public function setCountry(?string $country): self
  174.     {
  175.         $this->country $country;
  176.         return $this;
  177.     }
  178.     public function getRegion(): ?string
  179.     {
  180.         return $this->region;
  181.     }
  182.     public function setRegion(?string $region): self
  183.     {
  184.         $this->region $region;
  185.         return $this;
  186.     }
  187.     public function getCity(): ?string
  188.     {
  189.         return $this->city;
  190.     }
  191.     public function setCity(?string $city): self
  192.     {
  193.         $this->city $city;
  194.         return $this;
  195.     }
  196.     public function getAddress(): ?string
  197.     {
  198.         return $this->address;
  199.     }
  200.     public function setAddress(?string $address): self
  201.     {
  202.         $this->address $address;
  203.         return $this;
  204.     }
  205.     public function getCode1c(): ?string
  206.     {
  207.         return $this->code1c;
  208.     }
  209.     public function setCode1c(string $code1c): self
  210.     {
  211.         $this->code1c $code1c;
  212.         return $this;
  213.     }
  214.     public function getType(): ?string
  215.     {
  216.         return $this->type;
  217.     }
  218.     public function setType(?string $type): self
  219.     {
  220.         $this->type $type;
  221.         return $this;
  222.     }
  223.     public function getTypeList(): ?string
  224.     {
  225.         return $this->typeList;
  226.     }
  227.     public function setTypeList(?string $typeList): self
  228.     {
  229.         $this->typeList $typeList;
  230.         return $this;
  231.     }
  232. }