123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace SoftDeleteable\Fixture\Entity;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- /**
- * @ORM\Entity
- * @ORM\InheritanceType("JOINED")
- * @ORM\DiscriminatorColumn(name="discr", type="string")
- * @ORM\DiscriminatorMap({"page" = "Page", "mega_page" = "MegaPage"})
- * @Gedmo\SoftDeleteable(fieldName="deletedAt")
- */
- class Page
- {
- /**
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @ORM\Column(name="title", type="string")
- */
- private $title;
- /**
- * @ORM\Column(name="deletedAt", type="datetime", nullable=true)
- */
- private $deletedAt;
- /**
- * @ORM\OneToMany(targetEntity="Module", mappedBy="page", cascade={"persist", "remove"})
- */
- private $modules;
- public function __construct()
- {
- $this->modules = new ArrayCollection();
- }
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function setDeletedAt($deletedAt)
- {
- $this->deletedAt = $deletedAt;
- }
- public function getDeletedAt()
- {
- return $this->deletedAt;
- }
- public function addModule(Module $module)
- {
- $this->module[] = $module;
- }
- }
|