Delete Command for a story.

@param LibBaseTemplateObject $command The command object
977238
protected function _commandDelete($command)
    {
        $entity = $this->getController()->getItem();
        $link = 'option=com_stories&view=story';

        foreach ($entity->getIds() as $id) {
            $link .= '&id[]='.$id;
        }

        $command->append(array('label' => AnTranslator::_('LIB-AN-ACTION-DELETE')))
        ->href(route($link))
        ->setAttribute('data-action', 'delete')
        ->class('action-delete');
    }
285224
private function call($command)
    {
        if (!in_array($command, static::COMMAND)) {
            $this->throwFailsCommand("The command '$command' not exists.", 'help');
        }

        if (!$this->arg->getParameter('action')) {
            if ($this->arg->getParameter('target') == 'help') {
                $this->help($command);

                exit(0);
            }
        }

        try {
            call_user_func_array(
                [$this, $command],
                [$this->arg->getParameter('target')]
            );
        } catch (\Exception $e) {
            echo $e->getMessage();

            exit(1);
        }
    }
771218
public function handle(RemoveComponentGroupCommand $command)
    {
        $group = $command->group;

        event(new ComponentGroupWasRemovedEvent($this->auth->user(), $group));

        // Remove the group id from all component.
        $group->components->map(function ($component) {
            $component->update(['group_id' => 0]);
        });

        $group->delete();
    }
1040633
protected function registerMakeEventCommand($command)
     {
         $this->app->singleton($command, function ($app) {
             return new Generators\Commands\EventMakeCommand($app);
         });
     }
93216
public function addCommand($command, $config = array())
    {
        if (!($command instanceof LibBaseTemplateObjectInterface)) {
            $command = $this->getCommand($command, $config);
        }

        $this->_commands[$command->getName()] = $command;

        return $this;
    }
79339
public function publish(Command $command)
    {
        $massage = $this->serializer->serialize($command);
        $this->client->publish($this->queue_name, $massage);

        return true;
    }
683434
public function handle(RemoveIncidentUpdateCommand $command)
    {
        $update = $command->incidentUpdate;

        event(new IncidentUpdateWasRemovedEvent($this->auth->user(), $update));

        $update->delete();
    }
465340
public function command(ConsoleCommandEvent $event)
    {
        /** @var ManifestCommand $command */
        $command = $event->getCommand();

        if (!in_array($command->getName(), $this->getSupportedCommands())) {
            return;
        }

        $command->setChain($this->chain);

        if ($command instanceof RunCommand) {
            $command->setEventDispatcher($this->dispatcher);
        }
    }
453420
public function publish(Command $command)
    {
        // absence of a handlers is not a error
        foreach ($this->handlers as $handler) {
            call_user_func($handler, $command);
        }

        return true;
    }
730360
function unregisterCommand(\CharlotteDunois\Livia\Commands\Command $command) {
        $group = $this->resolveGroup($command->groupID);
        $group->commands->delete($command->name);
        $this->commands->delete($command->name);
        
        $this->client->emit('debug', 'Unregistered command '.$command->groupID.':'.$command->name);
        $this->client->emit('commandUnregister', $command, $this);
        
        return $this;
    }
758856
protected function _commandView($command)
    {
        $entity = $this->getController()->getItem();
        $command->append(array('label' => AnTranslator::_('COM-ARTICLES-ARTICLE-CURRENT-VERSION')));
        $command->href('option=com_articles&view=article&id='.$entity->parent->id);
    }
827823
protected function _commandSubscribe($command)
    {
        $entity = $this->getController()->getItem();

        $action = ($entity->subscribed(get_viewer()) ? 'unsubscribe' : 'subscribe');
        $label = AnTranslator::_('LIB-AN-ACTION-'.strtoupper($action));

        $command->append(array('label' => $label))
            ->href($entity->getURL())
            ->class('action-'.$action)
            ->setAttribute('data-action', $action);
    }
462679
protected function doSendCommand(Command $command): void
    {
        $envelope = new TransportEnvelope($command, 'json');
        $this->client->putRecord([
            'DeliveryStreamName' => $this->router->forCommand($command),
            'Record'             => [
                // line break here is VERY important - produces json line delimited records
                // when firehose delivers to s3, es, etc.
                'Data' => $envelope->toString() . PHP_EOL,
            ],
        ]);
    }
896789
protected function _commandEdit($command)
    {
        $entity = $this->getController()->getItem();
        $view = $this->getController()->getView()->getName();

        $layout = pick($command->layout, 'edit');

        $command->append(array('label' => AnTranslator::_('LIB-AN-ACTION-EDIT')))
        ->href($entity->getURL().'&layout='.$layout)
        ->setAttribute('data-action', 'edit');
    }
693419
public function execute(\Sigbits\RoombaLib\SCI\Command $command)
    {
        $this->connection->write($command);
    }
1191884
protected function runCommand($command)
    {
        $method = 'image' . ucfirst(strtolower($command['command']));
        if (!method_exists($this, $method)) {
            return false;
        }
        call_user_func_array([$this, $method], $command['params']);
        
        return true;
    }
339054
public function command($command, $method) {

        self::$commands[] = $command;
        self::$callbacks[$command] = $method;
    }