public function setProducts($product)
    {
        if (is_string($product)) {
            $product = [$product];
        }

        if (!is_array($product)) {
            throw new \InvalidArgumentException("The product list must be an string or an array, given " . gettype($product));
        }

        $this->products = $product;
    }
public function setProducts($product)
    {
        if (is_string($product)) {
            $product = [$product];
        }

        if (!is_array($product)) {
            throw new \InvalidArgumentException("The product list must be an string or an array, given " . gettype($product));
        }

        $this->products = $product;
    }
public function setProducts ( $ product ) { if ( is_string ( $ product ) ) { $ product = [ $ product ] ; } if ( ! is_array ( $ product ) ) { throw new \ InvalidArgumentException ( "The product list must be an string or an array, given " . gettype ( $ product ) ) ; } $ this -> products = $ product ; }
Set the product list
@param string|array $product
Set the product list