<?php
namespace App\Entities\Raca;

use App\Utils\Builder;
use App\Utils\Entity;

class RacaBuilder implements Builder
{
    protected $id;
    protected $nome;
    protected $id_especie;

    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    public function setNome($nome)
    {
        $this->nome = $nome;
        return $this;
    }

    public function setIdEspecie($id_especie)
    {
        $this->id_especie = $id_especie;
        return $this;
    }


    public function build() : Raca
    {
        $raca = new Raca();
        if (isset($this->id)) {
            $raca->setId($this->id);
        }
        if (isset($this->nome)) {
            $raca->setNome($this->nome);
        }
        if (isset($this->id_especie)) {
            $raca->setIdEspecie($this->id_especie);
        }
        return $raca;
    }
}