vendor/uvdesk/support-center-bundle/Entity/Solutions.php line 13

Open in your IDE?
  1. <?php
  2. namespace Webkul\UVDesk\SupportCenterBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Solutions
  6.  * @ORM\Entity(repositoryClass="Webkul\UVDesk\SupportCenterBundle\Repository\Solutions")
  7.  * @ORM\HasLifecycleCallbacks
  8.  * @ORM\Table(name="uv_solutions")
  9.  */
  10. class Solutions
  11. {
  12.     /**
  13.      * @var int
  14.      * @ORM\Id
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\GeneratedValue
  17.      */
  18.     private $id;
  19.     /**
  20.      * @var string
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @var string
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $description;
  29.     /**
  30.      * @var string
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $visibility;
  34.     /**
  35.      * @var int
  36.      * @ORM\Column(type="integer", options={"default": 5})
  37.      */
  38.     private $sortOrder;
  39.     /**
  40.      * Get id.
  41.      *
  42.      * @return int
  43.      */
  44.     public function getId()
  45.     {
  46.         return $this->id;
  47.     }
  48.     /**
  49.      * Set name.
  50.      *
  51.      * @param string $name
  52.      *
  53.      * @return Solutions
  54.      */
  55.     public function setName($name)
  56.     {
  57.         $this->name $name;
  58.         return $this;
  59.     }
  60.     /**
  61.      * Get name.
  62.      *
  63.      * @return string
  64.      */
  65.     public function getName()
  66.     {
  67.         return $this->name;
  68.     }
  69.     /**
  70.      * Set description.
  71.      *
  72.      * @param string $description
  73.      *
  74.      * @return Solutions
  75.      */
  76.     public function setDescription($description)
  77.     {
  78.         $this->description $description;
  79.         return $this;
  80.     }
  81.     /**
  82.      * Get description.
  83.      *
  84.      * @return string
  85.      */
  86.     public function getDescription()
  87.     {
  88.         return $this->description;
  89.     }
  90.     /**
  91.      * Set visibility.
  92.      *
  93.      * @param string $visibility
  94.      *
  95.      * @return Solutions
  96.      */
  97.     public function setVisibility($visibility)
  98.     {
  99.         $this->visibility $visibility;
  100.         return $this;
  101.     }
  102.     /**
  103.      * Get visibility.
  104.      *
  105.      * @return string
  106.      */
  107.     public function getVisibility()
  108.     {
  109.         return $this->visibility;
  110.     }
  111.     /**
  112.      * Set sortOrder.
  113.      *
  114.      * @param int $sortOrder
  115.      *
  116.      * @return Solutions
  117.      */
  118.     public function setSortOrder($sortOrder)
  119.     {
  120.         $this->sortOrder $sortOrder;
  121.         return $this;
  122.     }
  123.     /**
  124.      * Get sortOrder.
  125.      *
  126.      * @return int
  127.      */
  128.     public function getSortOrder()
  129.     {
  130.         return $this->sortOrder;
  131.     }
  132.     /**
  133.      * @var \DateTime
  134.      * @ORM\Column(type="datetime")
  135.      */
  136.     private $dateAdded;
  137.     /**
  138.      * @var \DateTime
  139.      * @ORM\Column(type="datetime")
  140.      */
  141.     private $dateUpdated;
  142.     
  143.     /**
  144.      * @var string|null
  145.      * @ORM\Column(type="string", length=255, nullable=true)
  146.      */
  147.     private $solutionImage;
  148.     /**
  149.      * Set dateAdded.
  150.      *
  151.      * @param \DateTime $dateAdded
  152.      *
  153.      * @return Solutions
  154.      */
  155.     public function setDateAdded($dateAdded)
  156.     {
  157.         $this->dateAdded $dateAdded;
  158.         return $this;
  159.     }
  160.     /**
  161.      * Get dateAdded.
  162.      *
  163.      * @return \DateTime
  164.      */
  165.     public function getDateAdded()
  166.     {
  167.         return $this->dateAdded;
  168.     }
  169.     /**
  170.      * Set dateUpdated.
  171.      *
  172.      * @param \DateTime $dateUpdated
  173.      *
  174.      * @return Solutions
  175.      */
  176.     public function setDateUpdated($dateUpdated)
  177.     {
  178.         $this->dateUpdated $dateUpdated;
  179.         return $this;
  180.     }
  181.     /**
  182.      * Get dateUpdated.
  183.      *
  184.      * @return \DateTime
  185.      */
  186.     public function getDateUpdated()
  187.     {
  188.         return $this->dateUpdated;
  189.     }
  190.     /**
  191.      * Set solutionImage.
  192.      *
  193.      * @param string|null $solutionImage
  194.      *
  195.      * @return Solutions
  196.      */
  197.     public function setSolutionImage($solutionImage null)
  198.     {
  199.         $this->solutionImage $solutionImage;
  200.         return $this;
  201.     }
  202.     /**
  203.      * Get solutionImage.
  204.      *
  205.      * @return string|null
  206.      */
  207.     public function getSolutionImage()
  208.     {
  209.         return $this->solutionImage;
  210.     }
  211.     //file upload   
  212.     public function upload($file$container)
  213.     {   
  214.         $container->get('file.service')->setRequiredFileSystem();
  215.         $container->get('file.service')->upload($file);
  216.     }
  217.     public function removeUpload($file$container)
  218.     {   
  219.         if($this->{$file} AND file_exists($this->{$file})){
  220.             //call service
  221.             $container->get('file.service')->removeUpload($file);
  222.         }
  223.     }
  224. }