Advertisement
Guest User

Untitled

a guest
Jul 29th, 2013
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.34 KB | None | 0 0
  1. <?php
  2.  
  3. namespace S4P\MainBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9.  
  10. /**
  11.  * Entry
  12.  *
  13.  * @ORM\Table()
  14.  * @ORM\Entity(repositoryClass="S4P\MainBundle\Entity\EntryRepository")
  15.  * @Vich\Uploadable
  16.  */
  17. class Entry {
  18.     /**
  19.      * @var integer
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.  
  27.     /**
  28.      * @var string
  29.      * @ORM\Column(name="title", type="string", length=128)
  30.      */
  31.     private $title;
  32.  
  33.     /**
  34.      * @var string
  35.      * @ORM\Column(name="text", type="text")
  36.      */
  37.     private $text;
  38.  
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="img_name", type="string", length=255)
  43.      */
  44.     private $img_name;
  45.  
  46.     /**
  47.      * @Assert\File(
  48.      *     maxSize="1M",
  49.      *     mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
  50.      * )
  51.      * @Vich\UploadableField(mapping="s4p_article_image", fileNameProperty="img_name")
  52.      *
  53.      * @var File $image
  54.      */
  55.     private $image;
  56.  
  57.     /**
  58.      * @var string
  59.      * @ORM\Column(name="author", type="string", length=255)
  60.      */
  61.     private $author;
  62.  
  63.     /**
  64.      * @var \DateTime
  65.      *
  66.      * @ORM\Column(name="pub_date", type="datetime")
  67.      * @Gedmo\Timestampable(on="create")
  68.      */
  69.     private $pub_date;
  70.  
  71.     /**
  72.      * @var
  73.      * @ORM\ManyToOne(targetEntity="Category", inversedBy="entries")
  74.      * @ORM\JoinColumn(name="cat_id", referencedColumnName="id")
  75.      */
  76.     private $category;
  77.  
  78.     /**
  79.      * @var string
  80.      * @ORM\Column(length=255, unique=true)
  81.      * @Gedmo\Slug(fields={"title"})
  82.      */
  83.     private $slug;
  84.  
  85.     /**
  86.      * @param mixed $category
  87.      */
  88.     public function setCategory(Category $category) {
  89.  
  90.         $category->addEntry($this);
  91.         $this->category = $category;
  92.     }
  93.  
  94.     /**
  95.      * @return mixed
  96.      */
  97.     public function getCategory() {
  98.         return $this->category;
  99.     }
  100.  
  101.  
  102.     /**
  103.      * Get id
  104.      *
  105.      * @return integer
  106.      */
  107.     public function getId() {
  108.         return $this->id;
  109.     }
  110.  
  111.     /**
  112.      * Set $text
  113.      *
  114.      * @param string $text
  115.      * @return Entry
  116.      */
  117.     public function setText($text) {
  118.         $this->$text = $text;
  119.     }
  120.  
  121.     /**
  122.      * @param mixed $title
  123.      */
  124.     public function setTitle($title) {
  125.         $this->title = $title;
  126.     }
  127.  
  128.     /**
  129.      * @return mixed
  130.      */
  131.     public function getTitle() {
  132.         return $this->title;
  133.     }
  134.  
  135.     /**
  136.      * @return slug
  137.      */
  138.     public function getSlug() {
  139.         return $this->slug;
  140.     }
  141.  
  142.  
  143.     /**
  144.      * Get entText
  145.      *
  146.      * @return string
  147.      */
  148.     public function getText() {
  149.         return $this->text;
  150.     }
  151.  
  152.     /**
  153.      * Set img
  154.      *
  155.      * @param string $img
  156.      * @return Entry
  157.      */
  158.     public function setImgName($img) {
  159.         $this->img_name = $img;
  160.  
  161.         return $this;
  162.     }
  163.  
  164.     /**
  165.      * Get imgLink
  166.      *
  167.      * @return string
  168.      */
  169.     public function getImgName() {
  170.         return $this->img_name;
  171.     }
  172.  
  173.     /**
  174.      * Set author
  175.      *
  176.      * @param string $author
  177.      * @return Entry
  178.      */
  179.     public function setAuthor($author) {
  180.         $this->author = $author;
  181.  
  182.         return $this;
  183.     }
  184.  
  185.     /**
  186.      * Get author
  187.      *
  188.      * @return string
  189.      */
  190.     public function getAuthor() {
  191.         return $this->author;
  192.     }
  193.  
  194.     /**
  195.      * Set pubDate
  196.      *
  197.      * @param \DateTime $pub_date
  198.      * @return Entry
  199.      */
  200.     public function setPubDate($pub_date) {
  201.         $this->pub_date = $pub_date;
  202.  
  203.         return $this;
  204.     }
  205.  
  206.     /**
  207.      * Get pubDate
  208.      *
  209.      * @return \DateTime
  210.      */
  211.     public function getPubDate() {
  212.         return $this->pub_date;
  213.     }
  214.  
  215.  
  216.     /**
  217.      * Set slug
  218.      *
  219.      * @param string $slug
  220.      * @return Entry
  221.      */
  222.     public function setSlug($slug) {
  223.         $this->slug = $slug;
  224.  
  225.         return $this;
  226.     }
  227.  
  228.     /**
  229.      * @param $image
  230.      */
  231.     public function setImage($image) {
  232.         $this->image = $image;
  233.     }
  234.  
  235.     /**
  236.      * @return image
  237.      */
  238.     public function getImage() {
  239.         return $this->image;
  240.     }
  241.  
  242.  
  243. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement