Advertisement
zukars3

Untitled

Mar 28th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1.     private $products;
  2.  
  3.     public function __construct(array $products = [])
  4.     {
  5.         foreach ($products as $product) {
  6.             if (!($product instanceof ProductInterface)) {
  7.                 die('Does not implement ProductInterface');
  8.             }
  9.             $this->products = $products;
  10.         }
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement