src/Entity/SupplierContact.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Class SupplierContact
  7.  *
  8.  * @ORM\Entity
  9.  * @ORM\Table(name="malys_supplier_contact")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  * @package App\Entity
  12.  */
  13. class SupplierContact
  14. {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="type", type="string", length=255, nullable=false)
  27.      */
  28.     protected $type;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="last_name", type="string", length=255, nullable=false)
  33.      */
  34.     protected $lastName;
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(name="mobile", type="string", length=255, nullable=false)
  39.      */
  40.     protected $mobile;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(name="email", type="string", length=255, nullable=false)
  45.      */
  46.     protected $email;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(name="comment", type="text", nullable=true)
  51.      */
  52.     protected $comment;
  53.     /**
  54.      * @var Supplier
  55.      *
  56.      * @ORM\ManyToOne(targetEntity="Supplier", inversedBy="contacts")
  57.      * @ORM\JoinColumn(name="supplier_id", referencedColumnName="id")
  58.      */
  59.     protected $supplier;
  60.     /**
  61.      * @var DateTime
  62.      *
  63.      * @ORM\Column(name="createdAt", type="datetime", nullable=false)
  64.      */
  65.     protected $createdAt;
  66.     /**
  67.      * @var DateTime
  68.      *
  69.      * @ORM\Column(name="updatedAt", type="datetime", nullable=true)
  70.      */
  71.     protected $updatedAt;
  72.     public function __toString()
  73.     {
  74.         return $this->getLastName();
  75.     }
  76.     /**
  77.      * @return int
  78.      */
  79.     public function getId()
  80.     {
  81.         return $this->id;
  82.     }
  83.     /**
  84.      * @param int $id
  85.      */
  86.     public function setId($id)
  87.     {
  88.         $this->id $id;
  89.     }
  90.     /**
  91.      * @return string
  92.      */
  93.     public function getType()
  94.     {
  95.         return $this->type;
  96.     }
  97.     /**
  98.      * @param string $type
  99.      */
  100.     public function setType($type)
  101.     {
  102.         $this->type $type;
  103.     }
  104.     /**
  105.      * @return string
  106.      */
  107.     public function getComment()
  108.     {
  109.         return $this->comment;
  110.     }
  111.     /**
  112.      * @param string $comment
  113.      */
  114.     public function setComment($comment)
  115.     {
  116.         $this->comment $comment;
  117.     }
  118.     /**
  119.      * @return string
  120.      */
  121.     public function getLastName()
  122.     {
  123.         return $this->lastName;
  124.     }
  125.     /**
  126.      * @param string $lastName
  127.      */
  128.     public function setLastName($lastName)
  129.     {
  130.         $this->lastName $lastName;
  131.     }
  132.     /**
  133.      * @return string
  134.      */
  135.     public function getMobile()
  136.     {
  137.         return $this->mobile;
  138.     }
  139.     /**
  140.      * @param string $mobile
  141.      */
  142.     public function setMobile($mobile)
  143.     {
  144.         $this->mobile $mobile;
  145.     }
  146.     /**
  147.      * @return string
  148.      */
  149.     public function getEmail()
  150.     {
  151.         return $this->email;
  152.     }
  153.     /**
  154.      * @param string $email
  155.      */
  156.     public function setEmail($email)
  157.     {
  158.         $this->email $email;
  159.     }
  160.     /**
  161.      * @return Supplier
  162.      */
  163.     public function getSupplier()
  164.     {
  165.         return $this->supplier;
  166.     }
  167.     /**
  168.      * @param Supplier $supplier
  169.      */
  170.     public function setSupplier($supplier)
  171.     {
  172.         $this->supplier $supplier;
  173.     }
  174.     /**
  175.      * @return DateTime
  176.      */
  177.     public function getCreatedAt()
  178.     {
  179.         return $this->createdAt;
  180.     }
  181.     /**
  182.      * Set createdAt
  183.      *
  184.      * @return SupplierContact
  185.      * @ORM\PrePersist
  186.      */
  187.     public function setCreatedAt()
  188.     {
  189.         $this->createdAt = new DateTime();
  190.         $this->updatedAt = new DateTime();
  191.         return $this;
  192.     }
  193.     /**
  194.      * @return DateTime
  195.      */
  196.     public function getUpdatedAt()
  197.     {
  198.         return $this->updatedAt;
  199.     }
  200.     /**
  201.      * Set updatedAt
  202.      *
  203.      * @return SupplierContact
  204.      * @ORM\PreUpdate
  205.      */
  206.     public function setUpdatedAt()
  207.     {
  208.         $this->updatedAt = new DateTime();
  209.         return $this;
  210.     }
  211. }