Advertisement
zukars3

Product.php

Apr 2nd, 2020
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. class Product
  4. {
  5.     private $name;
  6.     private $amount;
  7.     private $type;
  8.  
  9.     public function __construct(string $name, float $amount, string $type)
  10.     {
  11.         $this->name = $name;
  12.         $this->amount = $amount;
  13.         $this->type = $type;
  14.     }
  15.  
  16.     public function getName(): string
  17.     {
  18.         return $this->name;
  19.     }
  20.  
  21.     public function setName(string $name): void
  22.     {
  23.         $this->name = $name;
  24.     }
  25.  
  26.     public function getAmount(): float
  27.     {
  28.         return $this->amount;
  29.     }
  30.  
  31.     public function setAmount(float $amount): void
  32.     {
  33.         $this->amount = $amount;
  34.     }
  35.  
  36.     public function getType(): string
  37.     {
  38.         return $this->type;
  39.     }
  40.  
  41.     public function setType(string $type): void
  42.     {
  43.         $this->type = $type;
  44.     }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement