123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?php
- namespace Mapping\Fixture\Yaml;
- /**
- *
- * @Table(name="categories")
- * @Entity
- */
- class Category extends BaseCategory
- {
- /**
- * @var integer $id
- *
- * @Column(name="id", type="integer")
- * @Id
- * @GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @var string $title
- *
- * @Column(name="title", type="string", length=64)
- */
- private $title;
- /**
- * @var string $slug
- *
- * @Column(name="slug", type="string", length=64)
- */
- private $slug;
- /**
- * @var Entity\Category
- *
- * @OneToMany(targetEntity="Category", mappedBy="parent")
- */
- private $children;
- /**
- * @var Entity\Category
- *
- * @ManyToOne(targetEntity="Category", inversedBy="children")
- * @JoinColumns({
- * @JoinColumn(name="parent_id", referencedColumnName="id")
- * })
- */
- private $parent;
-
- private $changed;
- /**
- * Get id
- *
- * @return integer $id
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set title
- *
- * @param string $title
- */
- public function setTitle($title)
- {
- $this->title = $title;
- }
- /**
- * Get title
- *
- * @return string $title
- */
- public function getTitle()
- {
- return $this->title;
- }
- /**
- * Set slug
- *
- * @param string $slug
- */
- public function setSlug($slug)
- {
- $this->slug = $slug;
- }
- /**
- * Get slug
- *
- * @return string $slug
- */
- public function getSlug()
- {
- return $this->slug;
- }
- /**
- * Add children
- *
- * @param Entity\Category $children
- */
- public function addChildren(Category $children)
- {
- $this->children[] = $children;
- }
- /**
- * Get children
- *
- * @return Doctrine\Common\Collections\Collection $children
- */
- public function getChildren()
- {
- return $this->children;
- }
- /**
- * Set parent
- *
- * @param Entity\Category $parent
- */
- public function setParent($parent)
- {
- $this->parent = $parent;
- }
- /**
- * Get parent
- *
- * @return Entity\Category $parent
- */
- public function getParent()
- {
- return $this->parent;
- }
- }
|