This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 6th, 2012  |  syntax: PHP  |  size: 0.91 KB  |  views: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>
clone this paste RAW Paste Data