File: D:/HostingSpaces/SBogers10/immoginis.komma.pro/app/commands/PropertyImportCommand.php
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class PropertyImportCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'property:import';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description.';
private $propertyImportService;
/**
* PropertyImportCommand constructor.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$pis = App::make('\Komma\Kms\Properties\propertyImportService');
try{
$pis->import();
}
catch(\Exception $e){
\Log::info($e->getMessage());
\Log::info('Force hard property import');
$pisController = App::make('\Komma\Kms\Properties\PropertyController');
$pisController->deleteAndGetProperties();
}
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(// array('example', InputArgument::REQUIRED, 'An example argument.'),
);
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(// array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),
);
}
}