<?php

namespace App\Console\Commands;

use App\Console\Module\EntityHandler;
use Illuminate\Console\Command;

class IreEntity extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'ire:entity {moduleName} {entityName}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Generar entidad dentro de un módulo';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $moduleName = $this->argument('moduleName');
        $entityName = $this->argument('entityName');
        $entityHandler = new EntityHandler($moduleName, $entityName);
        $entityHandler->execute();
    }
}
