src/Entity/CompanyEndCustomer.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6.  * @ORM\Entity
  7.  */
  8. class CompanyEndCustomer extends EndCustomer
  9. {
  10.     /**
  11.      * @ORM\ManyToOne(
  12.      *     targetEntity="Company",
  13.      *     inversedBy="endCustomers"
  14.      * )
  15.      * @ORM\JoinColumn(
  16.      *     name="company_id",
  17.      *     referencedColumnName="id",
  18.      *     onDelete="cascade"
  19.      * )
  20.      * @Assert\NotNull
  21.      *
  22.      * @var Company
  23.      */
  24.     protected Company $company;
  25.     /**
  26.      * @param string  $name
  27.      * @param Company $company
  28.      */
  29.     public function __construct(string $nameCompany $company)
  30.     {
  31.         $this->company $company;
  32.         parent::__construct($name);
  33.     }
  34.     /**
  35.      * @return Company
  36.      */
  37.     public function getCompany(): Company
  38.     {
  39.         return $this->company;
  40.     }
  41.     /**
  42.      * @param Company $company
  43.      */
  44.     public function setCompany(Company $company): void
  45.     {
  46.         $this->company $company;
  47.     }
  48. }