<?php

namespace App\Exports;


use Maatwebsite\Excel\Concerns\WithMultipleSheets;


class ReporteMultiple implements WithMultipleSheets{

    public function setData($data)
    {
        $this->data = $data;
        return $this;
    }

    public function setDataCon($deps, $estado, $tipo)
    {
        $this->deps = $deps;
        $this->estado = $estado;
        $this->tipo = $tipo;
        return $this;
    }

    public function setTipo($tipo)
    {
        $this->tipoR = $tipo;
        return $this;
    }


    public function sheets(): array
    {
        $sheets = [];

        if ($this->tipoR==1){
            $sheets[] = ((new ReporteExport)->setData($this->data)->setTipo(1));
        }else {
            $sheets[] = ((new ReporteExport)->setData($this->deps)->setTipo(2));
            $sheets[] = ((new ReporteExport)->setData($this->estado)->setTipo(3));
            $sheets[] = ((new ReporteExport)->setData($this->tipo)->setTipo(4));
        }


        return $sheets;
    }

}