<?php
	class StockController extends StockModel {
		private $idStock;
		private $idUsuario;
		private $idCarro;
		private $qtdDisp;
		private $qtd;
		private $estado;

		public function __construct($idUsuario, $idCarro, $qtd){
			$this->idUsuario = $idUsuario;
			$this->idCarro = $idCarro;
			$this->qtd = $qtd;
		}

		public function addStock(){
			if($this->inputVazio() == false){
				header("location: ../index.php?Erro=CamposVazios!");
				exit();
			}
			$this->insertStock($this->idUsuario, $this->idCarro, $this->qtd);
		}

		private function inputVazio(){
			$result;
			if(empty($this->qtd)){
				$result = false;
			} else {
				$result = true;
			}
			return $result;
		}
	}