Commit 5674d8f8 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

FIX : isQuiet (erreur de sytaxe)

parent 1da398ae
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Oscar/src/Oscar/Command/OscarAdvancedCommandAbstract.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ abstract class OscarAdvancedCommandAbstract extends OscarCommandAbstract

    protected function isInteractive(): bool
    {
        return !($this->isForce() || !$this->getIO()->isQuiet);
        return !($this->isForce() || $this->isQuiet());
    }

    protected function isForce(): bool
+7 −2
Changes for module/Oscar/src/Oscar/Command/OscarCommandAbstract.php: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -17,12 +17,17 @@ use Zend\ServiceManager\ServiceManager;
abstract class OscarCommandAbstract extends Command
{

    const COMMAND_ACTIVITY_NOTIFICATION_UPDATE = 'activity:notification:update';

    const COMMAND_ACTIVITY_SEARCH_REINDEX = 'activity:search:reindex';
    const COMMAND_PERSON_SEARCH_REINDEX = 'person:search:reindex';

    const COMMAND_ACTIVITY_NOTIFICATION_UPDATE = 'activity:notification:update';

    const COMMAND_NOTIFICATIONS_REBUILD = 'notifications:rebuild';

    const COMMAND_ORGANIZATION_SEARCH_REINDEX = 'organization:search:reindex';

    const COMMAND_PERSON_SEARCH_REINDEX = 'person:search:reindex';

    /** @var ServiceManager ServiceManager */
    private $servicemanager;

+50 −0
Changes for module/Oscar/src/Oscar/Command/OscarNotificationsRebuildCommand.php: 50 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php
/**
 * Created by PhpStorm.
 * User: bouvry
 * Date: 04/10/19
 * Time: 11:49
 */

namespace Oscar\Command;

use Exception;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class OscarActivitySearchReindexCommand extends OscarAdvancedCommandAbstract
{
    protected static $defaultName = OscarCommandAbstract::COMMAND_ACTIVITY_SEARCH_REINDEX;

    const ARGUMENT_ACTIVITY_ID = 'activityid';

    protected function configure()
    {
        parent::configure();
        $this
            ->setDescription("Reconstruction de l'index de recherche pour une activité")
            ->addArgument(self::ARGUMENT_ACTIVITY_ID, InputArgument::REQUIRED, "ID de l'activité");
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        parent::execute($input, $output);

        $activityId = $input->getArgument(self::ARGUMENT_ACTIVITY_ID);

        try {
            $activity = $this->getProjectGrantService()->getActivityById($activityId);

            if (!$this->ask("Réindexer l'activité '$activity' ?")) {
                return 0;
            }

            $this->getProjectGrantService()->searchUpdate($activity);

            return $this->finalSuccess("Index de recherche mis à jour pour '$activity' mis à jour");
        } catch (Exception $e) {
            return $this->finalFatalError($e);
        }
    }
}
 No newline at end of file