src/Entity/Api/Search.php line 17

Open in your IDE?
  1. <?php
  2. namespace  App\Entity\Api;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use ApiPlatform\Core\Annotation\ApiFilter;
  7. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  8. /**
  9.  * @ORM\Entity
  10.  * @ApiResource(
  11.  * collectionOperations={"get"},
  12.  * itemOperations={})
  13.  * @ApiFilter(SearchFilter::class, properties={"keyword":"partial","type":"exact","site":"exact"})
  14.  */
  15. class Search {
  16.    
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\Column(type="string")
  20.      */
  21.     protected $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=2000)
  24.      */
  25.     protected $data;
  26.      /**
  27.      * @ORM\Column(type="string", length=200)
  28.      */
  29.     protected $type;
  30.       /**
  31.      * @ORM\Column(type="string", length=200)
  32.      */
  33.     protected $keyword;
  34.      /**
  35.      * @ORM\Column(type="array", nullable=true)
  36.      */
  37.     protected $site;
  38.     /**
  39.      * Get the value of data
  40.      */ 
  41.     public function getData()
  42.     {
  43.         return $this->data;
  44.     }
  45.     /**
  46.      * Set the value of data
  47.      *
  48.      * @return  self
  49.      */ 
  50.     public function setData($data)
  51.     {
  52.         $this->data $data;
  53.         return $this;
  54.     }
  55.     /**
  56.      * Get the value of id
  57.      */ 
  58.     public function getId()
  59.     {
  60.         return $this->id;
  61.     }
  62.     /**
  63.      * Set the value of id
  64.      *
  65.      * @return  self
  66.      */ 
  67.     public function setId($id)
  68.     {
  69.         $this->id $id;
  70.         return $this;
  71.     }
  72.     /**
  73.      * Get the value of keyword
  74.      */ 
  75.     public function getKeyword()
  76.     {
  77.         return $this->keyword;
  78.     }
  79.     /**
  80.      * Set the value of keyword
  81.      *
  82.      * @return  self
  83.      */ 
  84.     public function setKeyword($keyword)
  85.     {
  86.         $this->keyword $keyword;
  87.         return $this;
  88.     }
  89.     /**
  90.      * Get the value of type
  91.      */ 
  92.     public function getType()
  93.     {
  94.         return $this->type;
  95.     }
  96.     /**
  97.      * Set the value of type
  98.      *
  99.      * @return  self
  100.      */ 
  101.     public function setType($type)
  102.     {
  103.         $this->type $type;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get the value of site
  108.      */ 
  109.     public function getSite()
  110.     {
  111.         return $this->site;
  112.     }
  113.     /**
  114.      * Set the value of site
  115.      *
  116.      * @return  self
  117.      */ 
  118.     public function setSite($site)
  119.     {
  120.         $this->site $site;
  121.         return $this;
  122.     }
  123. }