Advertisement
Guest User

Untitled

a guest
Jul 29th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.83 KB | None | 0 0
  1. <?php
  2.  
  3. namespace S4P\MainBundle\Entity;
  4.  
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping as ORM;
  7.  
  8. /**
  9.  * Category
  10.  *
  11.  * @ORM\Table()
  12.  * @ORM\Entity(repositoryClass="S4P\MainBundle\Entity\CategoryRepository")
  13.  */
  14. class Category {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.  
  24.     /**
  25.      * @ORM\Column(name="title", type="string", length=255)
  26.      */
  27.     private $title;
  28.  
  29.     /**
  30.      * @ORM\Column(name="sub_title", type="string", length=255, nullable=true)
  31.      */
  32.     private $sub_title;
  33.  
  34.     /**
  35.      * @ORM\Column(name="solution_text", type="string", length=255, nullable=true)
  36.      */
  37.     private $solution_text;
  38.  
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="cat_text", type="text")
  43.      */
  44.     private $cat_text;
  45.  
  46.     /**
  47.      * @var $entries
  48.      * @ORM\OneToMany(targetEntity="Entry", mappedBy="category")
  49.      */
  50.     private $entries;
  51.  
  52.     function __construct() {
  53.         $this->entries = new ArrayCollection();
  54.     }
  55.  
  56.     /**
  57.      * @return mixed
  58.      */
  59.     public function getEntries() {
  60.         return $this->entries;
  61.     }
  62.  
  63.     public function addEntry(Entry $entry) {
  64.         $entry->setCategory($this);
  65.         $this->entries->add($entry);
  66.     }
  67.  
  68.     /**
  69.      * Get id
  70.      *
  71.      * @return integer
  72.      */
  73.     public function getId() {
  74.         return $this->id;
  75.     }
  76.  
  77.     /**
  78.      * @param $cat_text
  79.      */
  80.     public function setCatText($cat_text) {
  81.         $this->cat_text = $cat_text;
  82.     }
  83.  
  84.     /**
  85.      * @return cat_text
  86.      */
  87.     public function getCatText() {
  88.         return $this->cat_text;
  89.     }
  90.  
  91.  
  92.     /**
  93.      * Remove entries
  94.      *
  95.      * @param \S4P\MainBundle\Entity\Entry $entries
  96.      */
  97.     public function removeEntry(Entry $entries) {
  98.         $this->entries->removeElement($entries);
  99.     }
  100.  
  101.     /**
  102.      * Set title
  103.      *
  104.      * @param string $title
  105.      * @return Category
  106.      */
  107.     public function setTitle($title) {
  108.         $this->title = $title;
  109.  
  110.         return $this;
  111.     }
  112.  
  113.     /**
  114.      * Get title
  115.      *
  116.      * @return string
  117.      */
  118.     public function getTitle() {
  119.         return $this->title;
  120.     }
  121.  
  122.     /**
  123.      * @param mixed $sub_title
  124.      */
  125.     public function setSubTitle($sub_title) {
  126.         $this->sub_title = $sub_title;
  127.     }
  128.  
  129.     /**
  130.      * @return mixed
  131.      */
  132.     public function getSubTitle() {
  133.         return $this->sub_title;
  134.     }
  135.  
  136.     /**
  137.      * @param mixed $solution_text
  138.      */
  139.     public function setSolutionText($solution_text) {
  140.         $this->solution_text = $solution_text;
  141.     }
  142.  
  143.     /**
  144.      * @return mixed
  145.      */
  146.     public function getSolutionText() {
  147.         return $this->solution_text;
  148.     }
  149.  
  150. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement