123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace Sluggable\Fixture\Document;
- use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
- use Gedmo\Mapping\Annotation as Gedmo;
- /**
- * @ODM\Document
- */
- class RelativeSlug
- {
- /**
- * @ODM\Id
- */
- private $id;
- /**
- * @ODM\String
- */
- private $title;
- /**
- * @Gedmo\Slug(handlers={
- * @Gedmo\SlugHandler(class="Gedmo\Sluggable\Handler\RelativeSlugHandler", options={
- * @Gedmo\SlugHandlerOption(name="relationField", value="article"),
- * @Gedmo\SlugHandlerOption(name="relationSlugField", value="slug"),
- * @Gedmo\SlugHandlerOption(name="separator", value="/")
- * })
- * }, separator="-", updatable=true, fields={"title"})
- * @ODM\String
- */
- private $alias;
- /**
- * @ODM\ReferenceOne(targetDocument="Article")
- */
- private $article;
- public function setArticle(Article $article = null)
- {
- $this->article = $article;
- }
- public function getArticle()
- {
- return $this->article;
- }
- public function getId()
- {
- return $this->id;
- }
- public function setTitle($title)
- {
- $this->title = $title;
- }
- public function getTitle()
- {
- return $this->title;
- }
- public function getSlug()
- {
- return $this->alias;
- }
- }
|