Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Coddict\WebsiteBundle\Document;
- use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
- use Symfony\Component\Validator\Constraints as Assert;
- use Doctrine\Common\Collections\ArrayCollection;
- /** @PHPCRODM\Document(referenceable=true) */
- class Category
- {
- public function __construct()
- {
- $this->pages = new ArrayCollection();
- $this->routes = new ArrayCollection();
- }
- /** @PHPCRODM\Id */
- public $path;
- /** @PHPCRODM\String */
- public $name;
- /** @PHPCRODM\String */
- public $displayPicture;
- /** @PHPCRODM\Children */
- public $pages;
- /** @PHPCRODM\Referrers(filter="routeContent") **/
- public $routes;
- /** @PHPCRODM\String
- * Must be small, medium or large
- */
- public $boxSize = 'small';
- /** @PHPCRODM\ReferenceOne
- */
- public $defaultPage = null;
- /**
- * @PHPCRODM\Boolean
- */
- public $deleted = false;
- /**
- * @PHPCRODM\Boolean
- */
- public $hidden = false;
- /**
- * @PHPCRODM\Boolean
- */
- public $showMenu = true;
- public function getRelativePath()
- {
- $tmp = explode("/cms/content",$this->path);
- return $tmp[1];
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement