Advertisement
Guest User

Untitled

a guest
Oct 1st, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Entity;
  4.  
  5. class Product
  6. {
  7.     /** @var int */
  8.     private $id;
  9.  
  10.     /** @var string */
  11.     private $sku;
  12.  
  13.     public function __construct(int $id, string $sku)
  14.     {
  15.         $this->id  = $id;
  16.         $this->sku = $sku;
  17.     }
  18.  
  19.     public function getId(): int
  20.     {
  21.         return $this->id;
  22.     }
  23.  
  24.     public function setId(int $id): void
  25.     {
  26.         $this->id = $id;
  27.     }
  28.  
  29.     public function getSku(): string
  30.     {
  31.         return $this->sku;
  32.     }
  33.  
  34.     public function setSku(string $sku): void
  35.     {
  36.         $this->sku = $sku;
  37.     }
  38.  
  39.     public function __toString(): string
  40.     {
  41.         return "Product: " . $this->sku;
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement