Advertisement
Guest User

Untitled

a guest
Jun 6th, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Coddict\WebsiteBundle\Document;
  4.  
  5. use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8.  
  9. /** @PHPCRODM\Document(referenceable=true) */
  10. class Category
  11. {
  12.    
  13.     public function __construct()
  14.     {
  15.         $this->pages = new ArrayCollection();  
  16.         $this->routes = new ArrayCollection();  
  17.  
  18.     }
  19.    
  20.     /** @PHPCRODM\Id */
  21.     public $path;
  22.    
  23.     /** @PHPCRODM\String */
  24.     public $name;
  25.    
  26.     /** @PHPCRODM\String */
  27.     public $displayPicture;
  28.    
  29.     /** @PHPCRODM\Children */
  30.     public $pages;
  31.    
  32.     /** @PHPCRODM\Referrers(filter="routeContent") **/
  33.     public $routes;
  34.    
  35.      /** @PHPCRODM\String
  36.     * Must be small, medium or large        
  37.      */
  38.     public $boxSize = 'small';
  39.    
  40.    
  41.     /** @PHPCRODM\ReferenceOne
  42.     */
  43.     public $defaultPage = null;
  44.    
  45.     /**
  46.      * @PHPCRODM\Boolean
  47.      */
  48.     public $deleted = false;
  49.    
  50.     /**
  51.      * @PHPCRODM\Boolean
  52.      */
  53.     public $hidden = false;
  54.    
  55.     /**
  56.     * @PHPCRODM\Boolean
  57.     */
  58.     public $showMenu = true;
  59.    
  60.    
  61.     public function getRelativePath()
  62.     {
  63.         $tmp = explode("/cms/content",$this->path);
  64.         return $tmp[1];
  65.     }
  66.    
  67.    
  68.    
  69.    
  70.    
  71. }
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement