12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace Mapping\Fixture;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity
- */
- class Sluggable
- {
- /**
- * @ORM\Id
- * @ORM\GeneratedValue
- * @ORM\Column(type="integer")
- */
- private $id;
- /**
- * @ORM\Column(name="title", type="string", length=64)
- */
- private $title;
- /**
- * @ORM\Column(name="code", type="string", length=16)
- */
- private $code;
- /**
- * @Gedmo\Slug(handlers={
- * @Gedmo\SlugHandler(class="Gedmo\Sluggable\Handler\TreeSlugHandler", options={
- * @Gedmo\SlugHandlerOption(name="parentRelationField", value="parent"),
- * @Gedmo\SlugHandlerOption(name="separator", value="/")
- * }),
- * @Gedmo\SlugHandler(class="Gedmo\Sluggable\Handler\RelativeSlugHandler", options={
- * @Gedmo\SlugHandlerOption(name="relationField", value="user"),
- * @Gedmo\SlugHandlerOption(name="relationSlugField", value="slug"),
- * @Gedmo\SlugHandlerOption(name="separator", value="/")
- * })
- * }, separator="-", updatable=false, fields={"title", "code"})
- * @ORM\Column(name="slug", type="string", length=64, unique=true)
- */
- private $slug;
- /**
- * @ORM\ManyToOne(targetEntity="Sluggable")
- */
- private $parent;
- /**
- * @ORM\ManyToOne(targetEntity="User")
- */
- private $user;
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function setCode($code)
- {
- $this->code = $code;
- }
- public function getCode()
- {
- return $this->code;
- }
- public function getSlug()
- {
- return $this->slug;
- }
- }
|