Spec-Zone.ru › Laravel 10

SeedCommand

class SeedCommand extends Command (View source)

Трейты

ConfirmableTrait
CallsCommands
ConfiguresPrompts
HasParameters
InteractsWithIO
InteractsWithSignals
PromptsForMissingInput
Macroable

Свойства

protected Factory internal $components

Фабрика компонентов консоли.

from InteractsWithIO
protected InputInterface $input

Реализация интерфейса ввода.

from InteractsWithIO
protected OutputStyle $output

Реализация интерфейса вывода.

from InteractsWithIO
protected int $verbosity

Уровень подробности вывода команд по умолчанию.

from InteractsWithIO
protected array $verbosityMap

Сопоставление удобочитаемых уровней подробности с уровнями OutputInterface Symfony.

from InteractsWithIO
protected Signals|null $signals

Экземпляр регистратора сигналов.

from InteractsWithSignals
static protected array $macros

Зарегистрированные строковые макросы.

from Macroable
protected Application $laravel

Экземпляр приложения Laravel.

from Command
protected string $signature

Имя и сигнатура команды консоли.

from Command
protected string $name

Имя команды консоли.

protected string $description

Описание команды консоли.

protected string $help

Текст справки команды консоли.

from Command
protected bool $hidden

Указывает, должна ли команда отображаться в списке команд Artisan.

from Command
protected bool $isolated

Указывает, может ли выполняться только одна копия команды в данный момент.

from Command
protected int $isolatedExitCode

Код завершения по умолчанию для изолированных команд.

from Command
protected array $aliases

Псевдонимы имен команд консоли.

from Command
protected ConnectionResolverInterface $resolver

Экземпляр решателя подключений.

Методы

Команда resolveCommand(Command|string $command)

Разрешить экземпляр консольной команды для заданной команды.

из CallsCommands
int call(Command|string $command, array $arguments = [])

Вызвать другую консольную команду.

из CallsCommands
int callSilent(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

из CallsCommands
int callSilently(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

из CallsCommands
int runCommand(Command|string $command, array $arguments, OutputInterface $output)

Запустить заданную консольную команду.

из CallsCommands
ArrayInput createInputFromArguments(array $arguments)

Создать экземпляр ввода из заданных аргументов.

из CallsCommands
массив context()

Получить весь контекст, переданный команде.

из CallsCommands
void configurePrompts(InputInterface $input)

Настроить резервные варианты подсказок.

из ConfiguresPrompts
mixed promptUntilValid(Closure $prompt, bool|string $required, Closure|null $validate)

Подсказывать пользователю до тех пор, пока не будет выполнено условие проверки.

из ConfiguresPrompts
void restorePrompts()

Восстановить вывод подсказок.

из ConfiguresPrompts
void specifyParameters()

Указать аргументы и параметры команды.

из HasParameters
массив getArguments()

Получить аргументы консольной команды.

массив getOptions()

Получить параметры консольной команды.

bool hasArgument(string|int $name)

Определить, есть ли заданный аргумент.

из InteractsWithIO
массив|строка|bool|null argument(string|null $key = null)

Получить значение аргумента команды.

из InteractsWithIO
массив arguments()

Получить все аргументы, переданные команде.

из InteractsWithIO
bool hasOption(string $name)

Определить, есть ли заданный параметр.

из InteractsWithIO
строка|массив|bool|null option(string|null $key = null)

Получить значение параметра команды.

из InteractsWithIO
массив options()

Получить все параметры, переданные команде.

из InteractsWithIO
bool confirm(string $question, bool $default = false)

Подтвердить вопрос у пользователя.

из InteractsWithIO
mixed ask(string $question, string|null $default = null)

Задать вопрос пользователю.

из InteractsWithIO
mixed anticipate(string $question, array|callable $choices, string|null $default = null)

Задать вопрос пользователю с автодополнением.

из InteractsWithIO
mixed askWithCompletion(string $question, array|callable $choices, string|null $default = null)

Задать вопрос пользователю с автодополнением.

из InteractsWithIO
mixed secret(string $question, bool $fallback = true)

Задать вопрос пользователю, но скрыть ответ из консоли.

из InteractsWithIO
строка|массив choice(string $question, array $choices, string|int|null $default = null, mixed|null $attempts = null, bool $multiple = false)

Предложить пользователю один вариант из массива ответов.

из InteractsWithIO
void table(array $headers, Arrayable|array $rows, TableStyle|string $tableStyle = 'default', array $columnStyles = [])

Форматировать ввод в таблицу.

из InteractsWithIO
mixed|void withProgressBar(iterable|int $totalSteps, Closure $callback)

Выполнить заданный обратный вызов, продвигая полосу прогресса.

из InteractsWithIO
void info(string $string, int|string|null $verbosity = null)

Вывести строку как информационное сообщение.

из InteractsWithIO
void line(string $string, string|null $style = null, int|string|null $verbosity = null)

Вывести строку в стандартный вывод.

из InteractsWithIO
void comment(string $string, int|string|null $verbosity = null)

Вывести строку как комментарий.

из InteractsWithIO
void question(string $string, int|string|null $verbosity = null)

Вывести строку как вопрос.

из InteractsWithIO
void error(string $string, int|string|null $verbosity = null)

Вывести строку как сообщение об ошибке.

из InteractsWithIO
void warn(string $string, int|string|null $verbosity = null)

Вывести строку как предупреждение.

из InteractsWithIO
void alert(string $string, int|string|null $verbosity = null)

Вывести строку в окне оповещения.

из InteractsWithIO
$this newLine(int $count = 1)

Вывести пустую строку.

из InteractsWithIO
void setInput(InputInterface $input)

Установить реализацию интерфейса ввода.

из InteractsWithIO
void setOutput(OutputStyle $output)

Установить реализацию интерфейса вывода.

из InteractsWithIO
void setVerbosity(string|int $level)

Установить уровень детализации.

из InteractsWithIO
int parseVerbosity(string|int|null $level = null)

Получить уровень детализации в терминах уровня Symfony's OutputInterface.

из InteractsWithIO
OutputStyle getOutput()

Получить реализацию вывода.

из InteractsWithIO
Factory outputComponents()

Получить реализацию фабрики компонентов вывода.

из InteractsWithIO
trap($signals, $callback)

Без описания

из InteractsWithSignals
void untrap()

Отменить обработчики сигналов, установленные в обработчике команды.

из InteractsWithSignals
void interact(InputInterface $input, OutputInterface $output)

Взаимодействовать с пользователем перед проверкой ввода.

из PromptsForMissingInput
void promptForMissingArguments(InputInterface $input, OutputInterface $output)

Запросить у пользователя недостающие аргументы.

из PromptsForMissingInput
array promptForMissingArgumentsUsing()

Запросить недостающие аргументы ввода, используя возвращенные вопросы.

из PromptsForMissingInput
void afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)

Выполнить действия после того, как пользователя попросили о недостающих аргументах.

из PromptsForMissingInput
bool didReceiveOptions(InputInterface $input)

Содержит ли входные данные какие-либо опции, отличающиеся от значений по умолчанию?

из PromptsForMissingInput
static void macro(string $name, object|callable $macro)

Зарегистрировать пользовательское макрокоманду.

из Macroable
static void mixin(object $mixin, bool $replace = true)

Добавить другой объект в класс.

из Macroable
static bool hasMacro(string $name)

Проверка, зарегистрирована ли макрокоманду.

из Macroable
static void flushMacros()

Очистить существующие макрокоманды.

из Macroable
static mixed __callStatic(string $method, array $parameters)

Динамическая обработка вызовов класса.

из Macroable
mixed __call(string $method, array $parameters)

Динамическая обработка вызовов класса.

из Macroable
void __construct(ConnectionResolverInterface $resolver)

Создать новый экземпляр команды базы данных.

void configureUsingFluentDefinition()

Настроить команду консоли с помощью определения fluent.

из Command
void configureIsolation()

Настроить команду консоли для изоляции.

из Command
int run(InputInterface $input, OutputInterface $output)

Выполнить консольную команду.

из Command
int execute(InputInterface $input, OutputInterface $output)

Выполнить консольную команду.

из Command
CommandMutex commandIsolationMutex()

Получить экземпляр мьютекса изоляции команд для команды.

из Command
bool isHidden()

{@inheritdoc}

из Command
Command setHidden(bool $hidden = true)

{@inheritdoc}

из Command
Application getLaravel()

Получить экземпляр приложения Laravel.

из Command
void setLaravel(Container $laravel)

Установить экземпляр приложения Laravel.

из Command
bool confirmToProceed(string $warning = 'Application In Production', Closure|bool|null $callback = null)

Подтвердить перед выполнением действия.

из ConfirmableTrait
Closure getDefaultConfirmCallback()

Получить обратный вызов подтверждения по умолчанию.

из ConfirmableTrait
int handle()

Выполнить консольную команду.

Seeder getSeeder()

Получить экземпляр сидера из контейнера.

string getDatabase()

Получить имя подключения к базе данных для использования.

Подробности

abstract protected Command resolveCommand(Command|string $command)

Разрешить экземпляр консольной команды для заданной команды.

Parameters

Command|string $command

Return Value

Command

int call(Command|string $command, array $arguments = [])

Вызвать другую консольную команду.

Parameters

Command|string $command
array $arguments

Return Value

int

int callSilent(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

Parameters

Command|string $command
array $arguments

Return Value

int

int callSilently(Command|string $command, array $arguments = [])

Вызвать другую консольную команду без вывода.

Parameters

Command|string $command
array $arguments

Return Value

int

protected int runCommand(Command|string $command, array $arguments, OutputInterface $output)

Выполнить заданную консольную команду.

Parameters

Command|string $command
array $arguments
OutputInterface $output

Return Value

int

protected ArrayInput createInputFromArguments(array $arguments)

Создать экземпляр ввода из заданных аргументов.

Parameters

array $arguments

Return Value

ArrayInput

protected array context()

Получить весь контекст, переданный команде.

Return Value

array

protected void configurePrompts(InputInterface $input)

Настроить отступы запросов.

Parameters

InputInterface $input

Return Value

void

protected mixed promptUntilValid(Closure $prompt, bool|string $required, Closure|null $validate)

Запрашивать у пользователя до тех пор, пока заданный обратный вызов проверки не пройдет.

Parameters

Closure $prompt
bool|string $required
Closure|null $validate

Return Value

mixed

protected void restorePrompts()

Восстановить вывод запросов.

Return Value

void

protected void specifyParameters()

Указать аргументы и параметры команды.

Return Value

void

protected array getArguments()

Получить аргументы консольной команды.

Return Value

array

protected array getOptions()

Получить параметры консольной команды.

Return Value

array
END_OF_DOCUMENT_MARKER

bool hasArgument(string|int $name)

Определите, присутствует ли заданный аргумент.

Параметры

string|int $name

Значение возврата

bool

array|string|bool|null argument(string|null $key = null)

Получить значение аргумента команды.

Параметры

string|null $key

Значение возврата

array|string|bool|null

array arguments()

Получить все аргументы, переданные команде.

Значение возврата

array

bool hasOption(string $name)

Определите, присутствует ли заданный параметр.

Параметры

string $name

Значение возврата

bool

string|array|bool|null option(string|null $key = null)

Получить значение параметра команды.

Параметры

string|null $key

Значение возврата

string|array|bool|null

array options()

Получить все параметры, переданные команде.

Значение возврата

array

bool confirm(string $question, bool $default = false)

Подтвердить вопрос у пользователя.

Параметры

string $question
bool $default

Значение возврата

bool

mixed ask(string $question, string|null $default = null)

Запросить у пользователя ввод.

Параметры

string $question
string|null $default

Значение возврата

mixed

mixed anticipate(string $question, array|callable $choices, string|null $default = null)

Запросить у пользователя ввод с автодополнением.

Параметры

string $question
array|callable $choices
string|null $default

Значение возврата

mixed

mixed askWithCompletion(string $question, array|callable $choices, string|null $default = null)

Запросить у пользователя ввод с автодополнением.

Параметры

string $question
array|callable $choices
string|null $default

Значение возврата

mixed

mixed secret(string $question, bool $fallback = true)

Запросить у пользователя ввод, но скрыть ответ из консоли.

Параметры

string $question
bool $fallback

Значение возврата

mixed

string|array choice(string $question, array $choices, string|int|null $default = null, mixed|null $attempts = null, bool $multiple = false)

Предоставить пользователю единственный выбор из массива ответов.

Параметры

string $question
array $choices
string|int|null $default
mixed|null $attempts
bool $multiple

Значение возврата

string|array

void table(array $headers, Arrayable|array $rows, TableStyle|string $tableStyle = 'default', array $columnStyles = [])

Форматировать ввод в текстовую таблицу.

Параметры

array $headers
Arrayable|array $rows
TableStyle|string $tableStyle
array $columnStyles

Значение возврата

void

mixed|void withProgressBar(iterable|int $totalSteps, Closure $callback)

Выполнить заданный обратный вызов, продвигая полосу прогресса.

Параметры

iterable|int $totalSteps
Closure $callback

Значение возврата

mixed|void

void info(string $string, int|string|null $verbosity = null)

Вывести строку как информационное сообщение.

Параметры

string $string
int|string|null $verbosity

Значение возврата

void

void line(string $string, string|null $style = null, int|string|null $verbosity = null)

Вывести строку в стандартный вывод.

Параметры

string $string
string|null $style
int|string|null $verbosity

Значение возврата

void

void comment(string $string, int|string|null $verbosity = null)

Вывести строку как комментарий.

Параметры

string $string
int|string|null $verbosity

Значение возврата

void

void question(string $string, int|string|null $verbosity = null)

Вывести строку как вопрос.

Параметры

string $string
int|string|null $verbosity

Значение возврата

void

void error(string $string, int|string|null $verbosity = null)

Вывести строку как ошибку.

Параметры

string $string
int|string|null $verbosity

Значение возврата

void
END_OF_DOCUMENT_MARKER

void warn(string $string, int|string|null $verbosity = null)

Вывести строку как предупреждение.

Parameters

string $string
int|string|null $verbosity

Return Value

void

void alert(string $string, int|string|null $verbosity = null)

Вывести строку в окне оповещения.

Parameters

string $string
int|string|null $verbosity

Return Value

void

$this newLine(int $count = 1)

Вывести пустую строку.

Parameters

int $count

Return Value

$this

void setInput(InputInterface $input)

Установить реализацию интерфейса ввода.

Parameters

InputInterface $input

Return Value

void

void setOutput(OutputStyle $output)

Установить реализацию интерфейса вывода.

Parameters

OutputStyle $output

Return Value

void

protected void setVerbosity(string|int $level)

Установить уровень подробности.

Parameters

string|int $level

Return Value

void

protected int parseVerbosity(string|int|null $level = null)

Получить уровень подробности с точки зрения уровня OutputInterface Symfony.

Parameters

string|int|null $level

Return Value

int

OutputStyle getOutput()

Получить реализацию вывода.

Return Value

OutputStyle

Factory outputComponents()

Получить реализацию фабрики компонентов вывода.

Return Value

Factory

trap($signals, $callback)

Без описания

Parameters

$signals
$callback

void untrap()

internal

Отменить обработчики сигналов, установленные в обработчике команды.

Return Value

void

protected void interact(InputInterface $input, OutputInterface $output)

Взаимодействие с пользователем перед проверкой ввода.

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

protected void promptForMissingArguments(InputInterface $input, OutputInterface $output)

Запросить у пользователя отсутствующие аргументы.

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

protected array promptForMissingArgumentsUsing()

Запросить отсутствующие входные аргументы, используя возвращенные вопросы.

Return Value

array

protected void afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)

Выполнить действия после запроса у пользователя отсутствующих аргументов.

Parameters

InputInterface $input
OutputInterface $output

Return Value

void

protected bool didReceiveOptions(InputInterface $input)

Ввод содержит какие-либо параметры, отличающиеся от значений по умолчанию.

Parameters

InputInterface $input

Return Value

bool

static void macro(string $name, object|callable $macro)

Зарегистрировать пользовательское макро.

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

Смешать другой объект в класс.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

static bool hasMacro(string $name)

Проверяет, зарегистрировано ли макро.

Parameters

string $name

Return Value

bool

static void flushMacros()

Очистить существующие макросы.

Return Value

void

static mixed __callStatic(string $method, array $parameters)

Динамически обработать вызовы класса.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException
END_OF_DOCUMENT_MARKER

смешанный тип __call(string $method, array $parameters)

Динамически обрабатывает вызовы к классу.

Параметры

string $method
array $parameters

Возвращаемое значение

смешанный тип

Исключения

BadMethodCallException

void __construct(ConnectionResolverInterface $resolver)

Создаёт новый экземпляр команды создания базы данных.

Параметры

ConnectionResolverInterface $resolver

Возвращаемое значение

void

защищённый void configureUsingFluentDefinition()

Настраивает команду консоли с помощью определения fluent.

Возвращаемое значение

void

защищённый void configureIsolation()

Настраивает команду консоли для изоляции.

Возвращаемое значение

void

int run(InputInterface $input, OutputInterface $output)

Выполнить команду консоли.

Параметры

InputInterface $input
OutputInterface $output

Возвращаемое значение

int

защищённый int execute(InputInterface $input, OutputInterface $output)

Выполнить команду консоли.

Параметры

InputInterface $input
OutputInterface $output

Возвращаемое значение

int

защищённый CommandMutex commandIsolationMutex()

Получить экземпляр мьютекса изоляции команды для команды.

Возвращаемое значение

CommandMutex

bool isHidden()

{@inheritdoc}

Возвращаемое значение

bool

Command setHidden(bool $hidden = true)

{@inheritdoc}

Параметры

bool $hidden

Возвращаемое значение

Command

Application getLaravel()

Получить экземпляр приложения Laravel.

Возвращаемое значение

Application

void setLaravel(Container $laravel)

Установить экземпляр приложения Laravel.

Параметры

Container $laravel

Возвращаемое значение

void

bool confirmToProceed(string $warning = 'Application In Production', Closure|bool|null $callback = null)

Подтвердить перед выполнением действия.

Этот метод запрашивает подтверждение только в продакшн-среде.

Параметры

string $warning
Closure|bool|null $callback

Возвращаемое значение

bool

защищённый Closure getDefaultConfirmCallback()

Получить стандартную функцию обратного вызова подтверждения.

Возвращаемое значение

Closure

int handle()

Выполнить команду консоли.

Возвращаемое значение

int

защищённый Seeder getSeeder()

Получить экземпляр седера из контейнера.

Возвращаемое значение

Seeder

защищённый string getDatabase()

Получить имя подключения к базе данных для использования.

Возвращаемое значение

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Database/Console/Seeds/SeedCommand.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API