src/Entity/Customer.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\CustomerRepository")
  8.  * @ORM\Table(name="customer")
  9.  * @UniqueEntity("emailAddress")
  10.  */
  11. class Customer extends Person
  12. {
  13.     /**
  14.      * @ORM\Column(type="string", nullable=true)
  15.      */
  16.     private $customerNumber;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  19.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  20.      */
  21.     private $rentingPartner;
  22.     
  23.     public function __construct$blank false )
  24.     {
  25.         parent::__construct($blank);
  26.         if ($blank) {
  27.             $this->setRoles(['ROLE_CUSTOMER']);
  28.         }
  29.     }
  30.     /**
  31.      * @return mixed
  32.      */
  33.     public function getCustomerNumber()
  34.     {
  35.         return $this->customerNumber;
  36.     }
  37.     /**
  38.      * @param mixed $customerNumber
  39.      */
  40.     public function setCustomerNumber($customerNumber)
  41.     {
  42.         $this->customerNumber $customerNumber;
  43.     }
  44.     /**
  45.      * @return User
  46.      */
  47.     public function getRentingPartner()
  48.     {
  49.         return $this->rentingPartner;
  50.     }
  51.     /**
  52.      * @param mixed $rentingPartner
  53.      */
  54.     public function setRentingPartner(User $rentingPartner)
  55.     {
  56.         $this->rentingPartner $rentingPartner;
  57.     }
  58.     public function __toString()
  59.     {
  60.         return $this->getFullName();
  61.     }
  62. }