src/Entity/TypeStock.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use JsonSerializable;
  7. /**
  8.  * TypeStock
  9.  *
  10.  * @ORM\Table(name="type_stock")
  11.  * @ORM\Entity(repositoryClass="App\Repository\TypeStockRepository")
  12.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  13.  */
  14. class TypeStock implements JsonSerializable
  15. {
  16.     const VENTE "VNT";
  17.     const ISOLE "ISO";
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="libelle", type="string", length=255)
  30.      */
  31.     private $libelle;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="codecsp", type="string", length=3, nullable=true)
  36.      */
  37.     private $codecsp;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="code", type="string", length=3, nullable=true)
  42.      */
  43.     private $code;
  44.      /**
  45.      * @var DateTime
  46.      *
  47.      * @ORM\Column(name="deletedAt", type="datetime",nullable=true)
  48.      */
  49.     private $deletedAt;
  50.     /**
  51.      * Get id
  52.      *
  53.      * @return int
  54.      */
  55.     public function getId()
  56.     {
  57.         return $this->id;
  58.     }
  59.     /**
  60.      * Set libelle
  61.      *
  62.      * @param string $libelle
  63.      *
  64.      * @return TypeStock
  65.      */
  66.     public function setLibelle($libelle)
  67.     {
  68.         $this->libelle $libelle;
  69.         return $this;
  70.     }
  71.     /**
  72.      * Get libelle
  73.      *
  74.      * @return string
  75.      */
  76.     public function getLibelle()
  77.     {
  78.         return $this->libelle;
  79.     }
  80.     /**
  81.      * Set codecsp
  82.      *
  83.      * @param string $codecsp
  84.      *
  85.      * @return TypeStock
  86.      */
  87.     public function setCodecsp($codecsp)
  88.     {
  89.         $this->codecsp $codecsp;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Get codecsp
  94.      *
  95.      * @return string
  96.      */
  97.     public function getCodecsp()
  98.     {
  99.         return $this->codecsp;
  100.     }
  101.     /**
  102.      * Set deletedAt
  103.      *
  104.      * @param DateTime $deletedAt
  105.      *
  106.      * @return TypeStock
  107.      */
  108.     public function setDeletedAt($deletedAt)
  109.     {
  110.         $this->deletedAt $deletedAt;
  111.         return $this;
  112.     }
  113.     /**
  114.      * Get deletedAt
  115.      *
  116.      * @return DateTime
  117.      */
  118.     public function getDeletedAt()
  119.     {
  120.         return $this->deletedAt;
  121.     }
  122.     /**
  123.      * Set code
  124.      *
  125.      * @param string $code
  126.      *
  127.      * @return TypeStock
  128.      */
  129.     public function setCode($code)
  130.     {
  131.         $this->code $code;
  132.         return $this;
  133.     }
  134.     /**
  135.      * Get code
  136.      *
  137.      * @return string
  138.      */
  139.     public function getCode()
  140.     {
  141.         return $this->code;
  142.     }
  143.     public function jsonSerialize(){
  144.         return array(
  145.             "libelle" =>$this->getLibelle(),
  146.             "codeCSP" => $this->getCodecsp()
  147.         );
  148.     }
  149. }