Files
RecoReco/Console/RecoRecoCommand.php

33 lines
899 B
PHP

<?php
namespace Kanboard\Plugin\RecoReco\Console;
use Kanboard\Console\BaseCommand;
use Kanboard\Plugin\RecoReco\Model\RecoRecoModel;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* CLI entry point for the RecoReco engine. Run by cron (four times a day from v1.0). Can be run by
* hand to test: ./cli recoreco:run
*/
class RecoRecoCommand extends BaseCommand
{
protected function configure()
{
$this
->setName('recoreco:run')
->setDescription('Spawn RecoReco calendar-scheduled cards whose occurrence is due');
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$model = new RecoRecoModel($this->container);
$count = $model->run();
$output->writeln('RecoReco: spawned '.$count.' card(s).');
return 0;
}
}