src/Flexy/Apps/StockBundle/Entity/Stock.php line 13

  1. <?php
  2. namespace App\Flexy\Apps\StockBundle\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Flexy\ShopBundle\Entity\Order\OrderItem;
  5. use App\Flexy\Apps\StockBundle\Repository\StockRepository;
  6. use App\Flexy\ProductBundle\Entity\Product;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ApiResource]
  9. #[ORM\Entity(repositoryClassStockRepository::class)]
  10. class Stock extends OrderItem
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type'integer')]
  15.     private $id;
  16.     #[ORM\Column(type'string'length255)]
  17.     private ?string $movementType null;
  18.     #[ORM\Column(type'string'length255)]
  19.     private ?string $movementObjectif null;
  20.     #[ORM\ManyToOne(targetEntityArticle::class, inversedBy'stocks')]
  21.     private ?\App\Flexy\Apps\StockBundle\Entity\Article $article null;
  22.     #[ORM\ManyToOne(targetEntityDocument::class, inversedBy'stocks')]
  23.     private ?\App\Flexy\Apps\StockBundle\Entity\Document $document null;
  24.     public function __toString():string
  25.     {
  26.         return (string)$this->description;
  27.     }
  28.     public function getId(): int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getMovementType(): string
  33.     {
  34.         return $this->movementType;
  35.     }
  36.     public function setMovementType(string $movementType): self
  37.     {
  38.         $this->movementType $movementType;
  39.         return $this;
  40.     }
  41.     public function getMovementObjectif(): string
  42.     {
  43.         return $this->movementObjectif;
  44.     }
  45.     public function setMovementObjectif(string $movementObjectif): self
  46.     {
  47.         $this->movementObjectif $movementObjectif;
  48.         return $this;
  49.     }
  50.     public function getArticle(): Article
  51.     {
  52.         return $this->article;
  53.     }
  54.     public function setArticle(Article $article): self
  55.     {
  56.         $this->article $article;
  57.         return $this;
  58.     }
  59.     public function getDocument(): Document
  60.     {
  61.         return $this->document;
  62.     }
  63.     public function setDocument(Document $document): self
  64.     {
  65.         $this->document $document;
  66.         return $this;
  67.     }
  68. }