|
@@ -0,0 +1,210 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace FTTHBundle\Entity;
|
|
|
+
|
|
|
+use Doctrine\ORM\Mapping as ORM;
|
|
|
+use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
|
|
|
+use Gedmo\Mapping\Annotation as Gedmo;
|
|
|
+use JMS\Serializer\Annotation as JMS;
|
|
|
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ORM\Entity
|
|
|
+ */
|
|
|
+class PreSale
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="id", type="integer", nullable=false)
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue(strategy="AUTO")
|
|
|
+ */
|
|
|
+ private $id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=100, nullable=true)
|
|
|
+ */
|
|
|
+ protected $address;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="integer", nullable=false)
|
|
|
+ *
|
|
|
+ * @Assert\NotNull
|
|
|
+ */
|
|
|
+ private $clientId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\ManyToOne(targetEntity="Profile", fetch="EXTRA_LAZY")
|
|
|
+ * @ORM\JoinColumn(name="profile_id", referencedColumnName="id", onDelete="SET NULL")
|
|
|
+ *
|
|
|
+ * @Assert\NotNull
|
|
|
+ *
|
|
|
+ * @JMS\MaxDepth(1)
|
|
|
+ */
|
|
|
+ protected $profile;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="datetime", nullable=true)
|
|
|
+ */
|
|
|
+ protected $date;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="datetime")
|
|
|
+ *
|
|
|
+ * @Gedmo\Timestampable(on="create")
|
|
|
+ */
|
|
|
+ protected $created;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="datetime")
|
|
|
+ *
|
|
|
+ * @Gedmo\Timestampable(on="update")
|
|
|
+ */
|
|
|
+ protected $updated;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function __toString()
|
|
|
+ {
|
|
|
+ return (string)$this->clientId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getId()
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param integer $clientId
|
|
|
+ *
|
|
|
+ * @return PreSale
|
|
|
+ */
|
|
|
+ public function setClientId($clientId)
|
|
|
+ {
|
|
|
+ $this->clientId = $clientId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getClientId()
|
|
|
+ {
|
|
|
+ return $this->clientId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param DateTime $date
|
|
|
+ *
|
|
|
+ * @return PreSale
|
|
|
+ */
|
|
|
+ public function setDate($date)
|
|
|
+ {
|
|
|
+ $this->date = $date;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return DateTime
|
|
|
+ */
|
|
|
+ public function getDate()
|
|
|
+ {
|
|
|
+ return $this->date;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return \DateTime
|
|
|
+ */
|
|
|
+ public function getCreated()
|
|
|
+ {
|
|
|
+ return $this->created;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param \DateTime
|
|
|
+ *
|
|
|
+ * @return PreSale
|
|
|
+ */
|
|
|
+ public function setCreated($d)
|
|
|
+ {
|
|
|
+ $this->created = $d;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return \DateTime
|
|
|
+ */
|
|
|
+ public function getUpdated()
|
|
|
+ {
|
|
|
+ return $this->updated;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param \DateTime
|
|
|
+ *
|
|
|
+ * @return PreSale
|
|
|
+ */
|
|
|
+ public function setUpdated($updated)
|
|
|
+ {
|
|
|
+ $this->updated = $updated;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param Profile $profile
|
|
|
+ *
|
|
|
+ * @return PreSale
|
|
|
+ */
|
|
|
+ public function setProfile($profile)
|
|
|
+ {
|
|
|
+ $this->profile = $profile;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return Profile
|
|
|
+ */
|
|
|
+ public function getProfile()
|
|
|
+ {
|
|
|
+ return $this->profile;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $address
|
|
|
+ *
|
|
|
+ * @return PreSale
|
|
|
+ */
|
|
|
+ public function setAddress($address)
|
|
|
+ {
|
|
|
+ $this->address = $address;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getAddress()
|
|
|
+ {
|
|
|
+ return $this->address;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|