Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
- /**
- * LeadCooperation
- *
- * @ORM\Table(
- * name="app_lead_cooperation",
- * uniqueConstraints={
- * @ORM\UniqueConstraint(name="app_lead_cooperation_unique_idx", columns={"key"})
- * }
- * )
- * @ORM\Entity(repositoryClass="AppBundle\Entity\Repository\LeadCooperationRepository")
- *
- * @ORM\HasLifecycleCallbacks()
- *
- * @Config(
- * routeName="app_lead_cooperation_index",
- * routeView="app_lead_cooperation_view",
- * defaultValues={
- * "form"={
- * "grid_name"="app-lead-cooperation-grid",
- * }
- * }
- * )
- */
- class LeadCooperation
- {
- /**
- * @ORM\Id
- * @var string
- *
- * @ORM\Column(name="key", type="string", length=255, nullable=false, unique=true)
- */
- protected $key;
- /**
- * @var string
- *
- * @ORM\Column(name="name", type="string", length=255, nullable=false)
- */
- protected $name;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="created_at", type="datetime")
- */
- protected $createdAt;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="updated_at", type="datetime")
- */
- protected $updatedAt;
- /**
- * @return string
- */
- public function getKey()
- {
- return $this->key;
- }
- /**
- * @param string $key
- *
- * @return LeadCooperation
- */
- public function setKey($key)
- {
- $this->key = $key;
- return $this;
- }
- /**
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * @param string $name
- *
- * @return LeadCooperation
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Set createdAt
- *
- * @param \DateTime $createdAt
- *
- * @return LeadCooperation
- */
- public function setCreatedAt(\DateTime $createdAt)
- {
- $this->createdAt = $createdAt;
- return $this;
- }
- /**
- * Get createdAt
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->createdAt;
- }
- /**
- * Set updatedAt
- *
- * @param \DateTime $updatedAt
- *
- * @return LeadCooperation
- */
- public function setUpdatedAt(\DateTime $updatedAt)
- {
- $this->updatedAt = $updatedAt;
- return $this;
- }
- /**
- * Get updatedAt
- *
- * @return \DateTime
- */
- public function getUpdatedAt()
- {
- return $this->updatedAt;
- }
- /**
- * Pre persist event listener
- *
- * @ORM\PrePersist
- */
- public function beforeSave()
- {
- $this->setCreatedAt(new \DateTime('now', new \DateTimeZone('UTC')));
- $this->beforeUpdate();
- }
- /**
- * Pre update event handler
- *
- * @ORM\PreUpdate
- */
- public function beforeUpdate()
- {
- $this->setUpdatedAt(new \DateTime('now', new \DateTimeZone('UTC')));
- }
- /**
- * @return string
- */
- public function __toString()
- {
- return $this->getName();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement