xeonist

Notice.php

Nov 10th, 2011
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.09 KB | None | 0 0
  1. <?php
  2. // src/Dessin/PlanBundle/Entity/Notice.php
  3. namespace Dessin\PlanBundle\Entity;
  4.  
  5. use Doctrine\DBAL\Types\StringType;
  6.  
  7. use Doctrine\DBAL\Types\IntegerType;
  8.  
  9. use Doctrine\DBAL\Types\BooleanType;
  10.  
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
  14. use Dessin\ProfileBundle\Entity\Profile;
  15.  
  16. /**
  17. * @ORM\Entity
  18. * @ORM\Table(name="Notice")
  19. * @ORM\HasLifecycleCallbacks
  20. * @DoctrineAssert\UniqueEntity("name")
  21. */
  22. class Notice
  23. {
  24.  
  25.     /**
  26.     * @ORM\Id
  27.     * @ORM\Column(type="integer")
  28.     * @ORM\GeneratedValue(strategy="AUTO")
  29.     *
  30.     * @var integer $id
  31.     */
  32.     protected $id;
  33.    
  34.     /**
  35.     * @ORM\Column(type="string")
  36.     *
  37.     * @var string name
  38.     */
  39.     protected $name;
  40.    
  41.     /**
  42.     * @ORM\Column(type="string")
  43.     *
  44.     * @var string text
  45.     */
  46.     protected $text;
  47.    
  48. //* @ORM\OneToMany(targetEntity="Frame", mappedBy="notice", cascade={"persist","remove"})  
  49.     /**
  50.     * @ORM\OneToMany(targetEntity="Frame", mappedBy="notice")
  51.     *
  52.     */
  53.     protected $frames;
  54.    
  55.     /*
  56.     /**
  57.     * @ORM\ManyToOne(targetEntity="Dessin\ProfileBundle\Entity\Profile", inversedBy="notices")
  58.     * @ORM\JoinColumn(name="profile_id", referencedColumnName="id")
  59.     *
  60.     */
  61.     /*protected $profile;*/
  62.  
  63.     /**
  64.      * Get id
  65.      *
  66.      * @return integer
  67.      */
  68.     public function getId()
  69.     {
  70.         return $this->id;
  71.     }
  72.  
  73.     /**
  74.      * Set name
  75.      *
  76.      * @param string $name
  77.      */
  78.     public function setName($name)
  79.     {
  80.         $this->name = $name;
  81.     }
  82.  
  83.     /**
  84.      * Get name
  85.      *
  86.      * @return string
  87.      */
  88.     public function getName()
  89.     {
  90.         return $this->name;
  91.     }
  92.  
  93.     /**
  94.      * Set text
  95.      *
  96.      * @param string $text
  97.      */
  98.     public function setText($text)
  99.     {
  100.         $this->text = $text;
  101.     }
  102.  
  103.     /**
  104.      * Get text
  105.      *
  106.      * @return string
  107.      */
  108.     public function getText()
  109.     {
  110.         return $this->text;
  111.     }
  112.    
  113.    
  114.     public function __toString(){
  115.         return $this->getName();
  116.     }
  117.    
  118.    
  119.     public function __construct()
  120.     {
  121.         $this->frames = new \Doctrine\Common\Collections\ArrayCollection();
  122.     }
  123.    
  124.     /**
  125.      * Add frames
  126.      *
  127.      * @param Dessin\PlanBundle\Entity\Frame $frames
  128.      */
  129.     public function addFrame(\Dessin\PlanBundle\Entity\Frame $frames)
  130.     {
  131.         $this->frames[] = $frames;
  132.     }
  133.  
  134.     /**
  135.      * Get frames
  136.      *
  137.      * @return Doctrine\Common\Collections\Collection
  138.      */
  139.     public function getFrames()
  140.     {
  141.         return $this->frames;
  142.     }
  143.  
  144.     /*
  145.     /**
  146.      * Set profile
  147.      *
  148.      * @param Dessin\ProfileBundle\Entity\Profile $profile
  149.      */
  150.     /*public function setProfile(\Dessin\ProfileBundle\Entity\Profile $profile)
  151.     {
  152.         $this->profile = $profile;
  153.     }*/
  154.  
  155.     /*
  156.     /**
  157.      * Get profile
  158.      *
  159.      * @return Dessin\ProfileBundle\Entity\Profile
  160.      */
  161.     /*public function getProfile()
  162.     {
  163.         return $this->profile;
  164.     }*/
  165.    
  166.     /*
  167.     /**
  168.     * @ORM\PreRemove
  169.     */
  170.    /* public function preRemove() {
  171.     }*/
  172. }
  173.  
Advertisement
Add Comment
Please, Sign In to add comment