19 foreach ($seeders as $seed) {
20 $types[] = $seed::getType();
23 $this->setName(
'database:seed')
24 ->setDescription(
elgg_echo(
'cli:database:seed:description'))
25 ->addOption(
'limit',
'l', InputOption::VALUE_OPTIONAL,
26 elgg_echo(
'cli:database:seed:option:limit')
28 ->addOption(
'image_folder', null, InputOption::VALUE_OPTIONAL,
29 elgg_echo(
'cli:database:seed:option:image_folder')
31 ->addOption(
'type',
't', InputOption::VALUE_OPTIONAL,
34 ->addOption(
'create_since', null, InputOption::VALUE_OPTIONAL,
35 elgg_echo(
'cli:database:seed:option:create_since'),
'now' 37 ->addOption(
'create_until', null, InputOption::VALUE_OPTIONAL,
38 elgg_echo(
'cli:database:seed:option:create_until'),
'now' 40 ->addArgument(
'create', InputArgument::OPTIONAL,
41 elgg_echo(
'cli:database:seed:argument:create')
49 if (!class_exists(
'\Faker\Generator')) {
66 'limit' => $this->
option(
'limit'),
67 'image_folder' => $this->
option(
'image_folder'),
68 'type' => $this->
option(
'type'),
69 'create_since' => $this->
option(
'create_since'),
70 'create_until' => $this->
option(
'create_until'),
71 'create' => (bool) $this->
argument(
'create'),
72 'interactive' => !(bool) $this->
option(
'no-interaction'),
73 'cli_command' => $this,
81 return $e->getCode() ?: 3;
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
Abstract command with some utility methods.
_elgg_services()
Get the global service provider.
argument($name)
Returns argument value.
option($name)
Returns option value.
elgg-cli database:seed [–limit]
Namespace for generating in-memory filesystems.