MetaModels\DcGeneral\Dca\Builder\Builder::createCommand PHP Метод

createCommand() защищенный Метод

Build a command into the the command collection.
protected createCommand ( ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\View\CommandCollectionInterface $collection, string $operationName, array $queryParameters, string $icon, array $extraValues ) : Builder
$collection ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\View\CommandCollectionInterface The command collection.
$operationName string The operation name.
$queryParameters array The query parameters for the operation.
$icon string The icon to use in the backend.
$extraValues array The extra values for the command.
Результат Builder
    protected function createCommand(CommandCollectionInterface $collection, $operationName, $queryParameters, $icon, $extraValues)
    {
        $command = $this->getCommandInstance($collection, $operationName);
        $parameters = $command->getParameters();
        foreach ($queryParameters as $name => $value) {
            if (!isset($parameters[$name])) {
                $parameters[$name] = $value;
            }
        }
        if (!$command->getLabel()) {
            $command->setLabel($operationName . '.0');
            if (isset($extraValues['label'])) {
                $command->setLabel($extraValues['label']);
            }
        }
        if (!$command->getDescription()) {
            $command->setDescription($operationName . '.1');
            if (isset($extraValues['description'])) {
                $command->setDescription($extraValues['description']);
            }
        }
        $extra = $command->getExtra();
        $extra['icon'] = $icon;
        foreach ($extraValues as $name => $value) {
            if (!isset($extra[$name])) {
                $extra[$name] = $value;
            }
        }
        return $this;
    }