src/Entity/InsuranceCompany.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. #[ORM\Entity(repositoryClass"App\Repository\InsuranceCompanyRepository")]
  8. #[ORM\Table(name"insurance_company")]
  9. class InsuranceCompany
  10. {
  11.     #[ORM\OneToMany(targetEntityInsurance::class, mappedBy"insuranceCompany"cascade: ["persist"])]
  12.     private Collection|array $insurances;
  13.     #[ORM\Column(type"boolean")]
  14.     private bool $isDeleted false;
  15.     #[ORM\Column(name"createdAt"type"datetime")]
  16.     private DateTime $createdAt;
  17.     #[ORM\Column(name"id"type"integer")]
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue(strategy"AUTO")]
  20.     private ?int $id;
  21.     #[ORM\Column(type"string"length255nullabletrue)]
  22.     private ?string $gmapsAddress;
  23.     #[ORM\Column(type"string"length255nullabletrue)]
  24.     private ?string $city;
  25.     #[ORM\Column(name"zipCode"type"integer"nullabletrue)]
  26.     #[Assert\Length(min5max5)]
  27.     private ?int $zipCode;
  28.     #[ORM\Column(name"streetNumber"type"integer"nullabletrue)]
  29.     private ?int $streetNumber;
  30.     #[ORM\Column(name"address"type"string"length255nullabletrue)]
  31.     private ?string $address;
  32.     #[ORM\Column(name"name"type"string"length255)]
  33.     private string $name;
  34.     #[ORM\Column(name"site"type"string"length255)]
  35.     private string $site;
  36.     #[ORM\Column(name"bp"type"string"length255)]
  37.     private string $bp;
  38.     #[ORM\Column(name"phone"type"string"length255)]
  39.     private string $phone;
  40.     #[Assert\Email()]
  41.     #[ORM\Column(name"email"type"string"length255nullabletrue)]
  42.     private ?string $email;
  43.     public function __construct() {
  44.         $this->createdAt = new DateTime();
  45.     }
  46.     public function __toString() {
  47.         return $this->name;
  48.     }
  49.     /**
  50.      * Get id
  51.      *
  52.      * @return int
  53.      */
  54.     public function getId() {
  55.         return $this->id;
  56.     }
  57.     /**
  58.      * Set name
  59.      *
  60.      * @param string $name
  61.      *
  62.      * @return InsuranceCompany
  63.      */
  64.     public function setName($name) {
  65.         $this->name $name;
  66.         return $this;
  67.     }
  68.     /**
  69.      * Get name
  70.      *
  71.      * @return string
  72.      */
  73.     public function getName() {
  74.         return $this->name;
  75.     }
  76.     /**
  77.      * Set email
  78.      *
  79.      * @param string $email
  80.      *
  81.      * @return InsuranceCompany
  82.      */
  83.     public function setEmail($email) {
  84.         $this->email $email;
  85.         return $this;
  86.     }
  87.     /**
  88.      * Get email
  89.      *
  90.      * @return string
  91.      */
  92.     public function getEmail() {
  93.         return $this->email;
  94.     }
  95.     /**
  96.      * Set createdAt
  97.      *
  98.      * @param DateTime $createdAt
  99.      *
  100.      * @return InsuranceCompany
  101.      */
  102.     public function setCreatedAt($createdAt) {
  103.         $this->createdAt $createdAt;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get createdAt
  108.      *
  109.      * @return DateTime
  110.      */
  111.     public function getCreatedAt() {
  112.         return $this->createdAt;
  113.     }
  114.     /**
  115.      * Set gmapsAddress
  116.      *
  117.      * @param string $gmapsAddress
  118.      *
  119.      * @return InsuranceCompany
  120.      */
  121.     public function setGmapsAddress($gmapsAddress) {
  122.         $this->gmapsAddress $gmapsAddress;
  123.         return $this;
  124.     }
  125.     /**
  126.      * Get gmapsAddress
  127.      *
  128.      * @return string
  129.      */
  130.     public function getGmapsAddress() {
  131.         return $this->gmapsAddress;
  132.     }
  133.     /**
  134.      * Set city
  135.      *
  136.      * @param string $city
  137.      *
  138.      * @return InsuranceCompany
  139.      */
  140.     public function setCity($city) {
  141.         $this->city $city;
  142.         return $this;
  143.     }
  144.     /**
  145.      * Get city
  146.      *
  147.      * @return string
  148.      */
  149.     public function getCity() {
  150.         return $this->city;
  151.     }
  152.     /**
  153.      * Set zipCode
  154.      *
  155.      * @param integer $zipCode
  156.      *
  157.      * @return InsuranceCompany
  158.      */
  159.     public function setZipCode($zipCode) {
  160.         $this->zipCode $zipCode;
  161.         return $this;
  162.     }
  163.     /**
  164.      * Get zipCode
  165.      *
  166.      * @return integer
  167.      */
  168.     public function getZipCode() {
  169.         return $this->zipCode;
  170.     }
  171.     /**
  172.      * Set streetNumber
  173.      *
  174.      * @param integer $streetNumber
  175.      *
  176.      * @return InsuranceCompany
  177.      */
  178.     public function setStreetNumber($streetNumber) {
  179.         $this->streetNumber $streetNumber;
  180.         return $this;
  181.     }
  182.     /**
  183.      * Get streetNumber
  184.      *
  185.      * @return integer
  186.      */
  187.     public function getStreetNumber() {
  188.         return $this->streetNumber;
  189.     }
  190.     /**
  191.      * Set address
  192.      *
  193.      * @param string $address
  194.      *
  195.      * @return InsuranceCompany
  196.      */
  197.     public function setAddress($address) {
  198.         $this->address $address;
  199.         return $this;
  200.     }
  201.     /**
  202.      * Get address
  203.      *
  204.      * @return string
  205.      */
  206.     public function getAddress() {
  207.         return $this->address;
  208.     }
  209.     /**
  210.      * Set user
  211.      *
  212.      * @param \App\Entity\User $user
  213.      *
  214.      * @return InsuranceCompany
  215.      */
  216.     public function setUser(\App\Entity\User $user) {
  217.         $this->user $user;
  218.         return $this;
  219.     }
  220.     /**
  221.      * Get user
  222.      *
  223.      * @return \App\Entity\User
  224.      */
  225.     public function getUser() {
  226.         return $this->user;
  227.     }
  228.     /**
  229.      * Set isDeleted
  230.      *
  231.      * @param boolean $isDeleted
  232.      *
  233.      * @return InsuranceCompany
  234.      */
  235.     public function setIsDeleted($isDeleted) {
  236.         $this->isDeleted $isDeleted;
  237.         return $this;
  238.     }
  239.     /**
  240.      * Get isDeleted
  241.      *
  242.      * @return boolean
  243.      */
  244.     public function getIsDeleted() {
  245.         return $this->isDeleted;
  246.     }
  247.     /**
  248.      * Set phone.
  249.      *
  250.      * @param string $phone
  251.      *
  252.      * @return InsuranceCompany
  253.      */
  254.     public function setPhone($phone)
  255.     {
  256.         $this->phone $phone;
  257.         return $this;
  258.     }
  259.     /**
  260.      * Get phone.
  261.      *
  262.      * @return string
  263.      */
  264.     public function getPhone()
  265.     {
  266.         return $this->phone;
  267.     }
  268.     /**
  269.      * Set site.
  270.      *
  271.      * @param string $site
  272.      *
  273.      * @return InsuranceCompany
  274.      */
  275.     public function setSite($site)
  276.     {
  277.         $this->site $site;
  278.         return $this;
  279.     }
  280.     /**
  281.      * Get site.
  282.      *
  283.      * @return string
  284.      */
  285.     public function getSite()
  286.     {
  287.         return $this->site;
  288.     }
  289.     /**
  290.      * Set bp.
  291.      *
  292.      * @param string $bp
  293.      *
  294.      * @return InsuranceCompany
  295.      */
  296.     public function setBp($bp)
  297.     {
  298.         $this->bp $bp;
  299.         return $this;
  300.     }
  301.     /**
  302.      * Get bp.
  303.      *
  304.      * @return string
  305.      */
  306.     public function getBp()
  307.     {
  308.         return $this->bp;
  309.     }
  310.     /**
  311.      * Add insurance.
  312.      *
  313.      * @param \App\Entity\Insurance $insurance
  314.      *
  315.      * @return InsuranceCompany
  316.      */
  317.     public function addInsurance(\App\Entity\Insurance $insurance)
  318.     {
  319.         $this->insurances[] = $insurance;
  320.         return $this;
  321.     }
  322.     /**
  323.      * Remove insurance.
  324.      *
  325.      * @param \App\Entity\Insurance $insurance
  326.      *
  327.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  328.      */
  329.     public function removeInsurance(\App\Entity\Insurance $insurance)
  330.     {
  331.         return $this->insurances->removeElement($insurance);
  332.     }
  333.     /**
  334.      * Get insurances.
  335.      *
  336.      * @return \Doctrine\Common\Collections\Collection
  337.      */
  338.     public function getInsurances()
  339.     {
  340.         return $this->insurances;
  341.     }
  342. }