public function setItems(array $items)
    {
        $cont = 0;
        $fItems = [];
        foreach ($items as $item) {
            $cont++;

            $fItems = array_merge($fItems, [
              'itemId'.$cont          => $this->sanitize($item, 'itemId'),
              'itemDescription'.$cont => $this->sanitize($item, 'itemDescription'),
              'itemAmount'.$cont      => $this->sanitizeMoney($item, 'itemAmount'),
              'itemQuantity'.$cont    => $this->sanitizeNumber($item, 'itemQuantity'),
            ]);
        }

        $this->itemsCount = $cont;
        $this->validateItems($fItems);
        $this->items = $fItems;

        return $this;
    }
public function setItems(array $items)
    {
        $cont = 0;
        $fItems = [];
        foreach ($items as $item) {
            $cont++;

            $fItems = array_merge($fItems, [
              'itemId'.$cont          => $this->sanitize($item, 'itemId'),
              'itemDescription'.$cont => $this->sanitize($item, 'itemDescription'),
              'itemAmount'.$cont      => $this->sanitizeMoney($item, 'itemAmount'),
              'itemQuantity'.$cont    => $this->sanitizeNumber($item, 'itemQuantity'),
            ]);
        }

        $this->itemsCount = $cont;
        $this->validateItems($fItems);
        $this->items = $fItems;

        return $this;
    }
public function setItems ( array $ items ) { $ cont = 0 ; $ fItems = [ ] ; foreach ( $ items as $ item ) { $ cont ++ ; $ fItems = array_merge ( $ fItems , [ 'itemId' . $ cont => $ this -> sanitize ( $ item , 'itemId' ) , 'itemDescription' . $ cont => $ this -> sanitize ( $ item , 'itemDescription' ) , 'itemAmount' . $ cont => $ this -> sanitizeMoney ( $ item , 'itemAmount' ) , 'itemQuantity' . $ cont => $ this -> sanitizeNumber ( $ item , 'itemQuantity' ) , ] ) ; } $ this -> itemsCount = $ cont ; $ this -> validateItems ( $ fItems ) ; $ this -> items = $ fItems ; return $ this ; }
Define os itens da compra.

@param array $items

@return $this
Define os itens da compra .