Advertisement
Guest User

Untitled

a guest
Jun 6th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 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.  
  10. /** @PHPCRODM\Document(referenceable=true) */
  11. class Page
  12. {
  13.    
  14.    
  15.     /** @PHPCRODM\Id */
  16.     public $path;
  17.    
  18.     /** @PHPCRODM\String */
  19.     public $name;
  20.    
  21.     /** @PHPCRODM\String */
  22.     public $content;
  23.    
  24.     /** @PHPCRODM\ParentDocument */
  25.     public $category;
  26.    
  27.     /** @PHPCRODM\Referrers(filter="routeContent") **/
  28.     public $routes;
  29.    
  30.     /**
  31.      * @PHPCRODM\Boolean
  32.      */
  33.     public $deleted = false;
  34.    
  35.     /**
  36.      * @PHPCRODM\Boolean
  37.      */
  38.     public $hidden = false;
  39.    
  40.    
  41.     public function getRelativePath()
  42.     {
  43.         $tmp = explode("/cms/content",$this->path);
  44.         return $tmp[1];
  45.     }
  46.    
  47.    
  48.    
  49.    
  50. }
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement