src/FoundersBundle/Entity/Post.php line 11

Open in your IDE?
  1. <?php
  2. namespace FoundersBundle\Entity;
  3. use Application\Sonata\MediaBundle\Entity\Media;
  4. use DateTime;
  5. /**
  6.  * Post
  7.  */
  8. class Post
  9. {
  10.     /**
  11.      * @var int
  12.      */
  13.     private $id;
  14.     /**
  15.      * @var string
  16.      */
  17.     private $title;
  18.     /**
  19.      * @var string
  20.      */
  21.     private $description_shot;
  22.     /**
  23.      * @var string
  24.      */
  25.     private $description;
  26.     /**
  27.      * @var string|null
  28.      */
  29.     private $seo_title;
  30.     /**
  31.      * @var string|null
  32.      */
  33.     private $seo_description;
  34.     /**
  35.      * @var string
  36.      */
  37.     private $url;
  38.     /**
  39.      * @var int|null
  40.      */
  41.     private $post_type;
  42.     /**
  43.      * @var DateTime
  44.      */
  45.     private $created;
  46.     /**
  47.      * @var int
  48.      */
  49.     private $position 0;
  50.     /**
  51.      * @var Media
  52.      */
  53.     private $image_preview;
  54.     /**
  55.      * @var Media
  56.      */
  57.     private $image;
  58.     /**
  59.      * Get id.
  60.      *
  61.      * @return int
  62.      */
  63.     public function getId()
  64.     {
  65.         return $this->id;
  66.     }
  67.     /**
  68.      * Set title.
  69.      *
  70.      * @param string $title
  71.      *
  72.      * @return Post
  73.      */
  74.     public function setTitle($title)
  75.     {
  76.         $this->title $title;
  77.         return $this;
  78.     }
  79.     /**
  80.      * Get title.
  81.      *
  82.      * @return string
  83.      */
  84.     public function getTitle()
  85.     {
  86.         return $this->title;
  87.     }
  88.     /**
  89.      * Set descriptionShot.
  90.      *
  91.      * @param string $descriptionShot
  92.      *
  93.      * @return Post
  94.      */
  95.     public function setDescriptionShot($descriptionShot)
  96.     {
  97.         $this->description_shot $descriptionShot;
  98.         return $this;
  99.     }
  100.     /**
  101.      * Get descriptionShot.
  102.      *
  103.      * @return string
  104.      */
  105.     public function getDescriptionShot()
  106.     {
  107.         return $this->description_shot;
  108.     }
  109.     /**
  110.      * Set description.
  111.      *
  112.      * @param string $description
  113.      *
  114.      * @return Post
  115.      */
  116.     public function setDescription($description)
  117.     {
  118.         $this->description $description;
  119.         return $this;
  120.     }
  121.     /**
  122.      * Get description.
  123.      *
  124.      * @return string
  125.      */
  126.     public function getDescription()
  127.     {
  128.         return $this->description;
  129.     }
  130.     /**
  131.      * Set seoTitle.
  132.      *
  133.      * @param string|null $seoTitle
  134.      *
  135.      * @return Post
  136.      */
  137.     public function setSeoTitle($seoTitle null)
  138.     {
  139.         $this->seo_title $seoTitle;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get seoTitle.
  144.      *
  145.      * @return string|null
  146.      */
  147.     public function getSeoTitle()
  148.     {
  149.         return $this->seo_title;
  150.     }
  151.     /**
  152.      * Set seoDescription.
  153.      *
  154.      * @param string|null $seoDescription
  155.      *
  156.      * @return Post
  157.      */
  158.     public function setSeoDescription($seoDescription null)
  159.     {
  160.         $this->seo_description $seoDescription;
  161.         return $this;
  162.     }
  163.     /**
  164.      * Get seoDescription.
  165.      *
  166.      * @return string|null
  167.      */
  168.     public function getSeoDescription()
  169.     {
  170.         return $this->seo_description;
  171.     }
  172.     /**
  173.      * Set url.
  174.      *
  175.      * @param string $url
  176.      *
  177.      * @return Post
  178.      */
  179.     public function setUrl($url)
  180.     {
  181.         $this->url $url;
  182.         return $this;
  183.     }
  184.     /**
  185.      * Get url.
  186.      *
  187.      * @return string
  188.      */
  189.     public function getUrl()
  190.     {
  191.         return $this->url;
  192.     }
  193.     /**
  194.      * Set postType.
  195.      *
  196.      * @param int|null $postType
  197.      *
  198.      * @return Post
  199.      */
  200.     public function setPostType($postType null)
  201.     {
  202.         $this->post_type $postType;
  203.         return $this;
  204.     }
  205.     /**
  206.      * Get postType.
  207.      *
  208.      * @return int|null
  209.      */
  210.     public function getPostType()
  211.     {
  212.         return $this->post_type;
  213.     }
  214.     /**
  215.      * Set created.
  216.      *
  217.      * @param DateTime $created
  218.      *
  219.      * @return Post
  220.      */
  221.     public function setCreated($created)
  222.     {
  223.         $this->created $created;
  224.         return $this;
  225.     }
  226.     /**
  227.      * Get created.
  228.      *
  229.      * @return DateTime
  230.      */
  231.     public function getCreated()
  232.     {
  233.         return $this->created;
  234.     }
  235.     /**
  236.      * Set position.
  237.      *
  238.      * @param int $position
  239.      *
  240.      * @return Post
  241.      */
  242.     public function setPosition($position)
  243.     {
  244.         $this->position $position;
  245.         return $this;
  246.     }
  247.     /**
  248.      * Get position.
  249.      *
  250.      * @return int
  251.      */
  252.     public function getPosition()
  253.     {
  254.         return $this->position;
  255.     }
  256.     /**
  257.      * Set imagePreview.
  258.      *
  259.      * @param Media|null $imagePreview
  260.      *
  261.      * @return Post
  262.      */
  263.     public function setImagePreview(Media $imagePreview null)
  264.     {
  265.         $this->image_preview $imagePreview;
  266.         return $this;
  267.     }
  268.     /**
  269.      * Get imagePreview.
  270.      *
  271.      * @return Media|null
  272.      */
  273.     public function getImagePreview()
  274.     {
  275.         return $this->image_preview;
  276.     }
  277.     /**
  278.      * Set image.
  279.      *
  280.      * @param Media|null $image
  281.      *
  282.      * @return Post
  283.      */
  284.     public function setImage(Media $image null)
  285.     {
  286.         $this->image $image;
  287.         return $this;
  288.     }
  289.     /**
  290.      * Get image.
  291.      *
  292.      * @return Media|null
  293.      */
  294.     public function getImage()
  295.     {
  296.         return $this->image;
  297.     }
  298.     /**
  299.      * @var int
  300.      */
  301.     private $state;
  302.     /**
  303.      * Set state.
  304.      *
  305.      * @param int $state
  306.      *
  307.      * @return Post
  308.      */
  309.     public function setState($state)
  310.     {
  311.         $this->state $state;
  312.         return $this;
  313.     }
  314.     /**
  315.      * Get state.
  316.      *
  317.      * @return int
  318.      */
  319.     public function getState()
  320.     {
  321.         return $this->state 0;
  322.     }
  323.     /**
  324.      * @var string
  325.      */
  326.     private $publication_source;
  327.     /**
  328.      * Set publicationSource.
  329.      *
  330.      * @param string $publicationSource
  331.      *
  332.      * @return Post
  333.      */
  334.     public function setPublicationSource($publicationSource)
  335.     {
  336.         $this->publication_source $publicationSource;
  337.         return $this;
  338.     }
  339.     /**
  340.      * Get publicationSource.
  341.      *
  342.      * @return string
  343.      */
  344.     public function getPublicationSource()
  345.     {
  346.         return $this->publication_source;
  347.     }
  348.     /**
  349.      * @var CategoryPost
  350.      */
  351.     private $category;
  352.     /**
  353.      * Set category.
  354.      *
  355.      * @param CategoryPost|null $category
  356.      *
  357.      * @return Post
  358.      */
  359.     public function setCategory(CategoryPost $category null)
  360.     {
  361.         $this->category $category;
  362.         return $this;
  363.     }
  364.     /**
  365.      * Get category.
  366.      *
  367.      * @return CategoryPost|null
  368.      */
  369.     public function getCategory()
  370.     {
  371.         return $this->category;
  372.     }
  373.     public function getCategoryUrlById()
  374.     {
  375.         return \FoundersBundle\Model\Post::getCategoryUrl($this->post_type);
  376.     }
  377.     public function getCategoryTitleByTypeId()
  378.     {
  379.         return \FoundersBundle\Model\Post::getCategoryTitleByTypeId($this->post_type);
  380.     }
  381. }