Skip to main content
Version: 2.0.0

Developer / API

Console commands

Plugin::init() registers three flat console controller IDs directly on the app's controllerMap — there is no generator or import sub-segment, so commands are seeder/<action>, seeder-cron/<action>, and seeder-import/<action>.

caution

The plugin's own README.md and COMMANDS.md (and a docblock on CronController) describe commands shaped like seeder/generator/customers and seeder/cron/run. Those do not resolve — Yii console action IDs cannot contain a slash, and the controller is registered under the flat key seeder (and seeder-cron), not a nested seeder/generator module. Use the commands below, which match the actual controllerMap registration in Plugin.php.

Generator (GeneratorController, registered as seeder)

CommandPurpose
seeder/wizardInteractive guided flow to pick generator, dataset, and product type. Supports --yes, --non-interactive, --profile=<handle>.
seeder/customers <count>Generate customers.
seeder/products <count> [--category=<handle>]Generate products, optionally from one category dataset.
seeder/orders <count> [--order-scenario=standard|holiday-sale|subscription-renewals]Generate orders from existing customers/products.
seeder/coupons <count>Generate coupons.
seeder/gift-cards <count>Generate gift cards and gift card accounts.
seeder/catalog-rules <count>Generate catalog price rules.
seeder/payment-methods <count>Seed payment methods from data/payments/methods.json.
seeder/shipping-fees <count>Seed shipping fees from data/shipping/fees.json.
seeder/shipping-zones <count>Seed shipping zones from data/shipping/zones.json.
seeder/shipping-table-rates <count>Seed shipping table rates from data/shipping/table-rates.json.
seeder/shipping-methods <count>Seed shipping methods from data/shipping/methods.json.
seeder/generateLegacy interactive product/category generation flow.
seeder/statusCounts of seeded products, customers, orders, profiles, and enabled currencies.
seeder/reset [<profile-handle>]Purges configured data and regenerates it from the active or specified profile. Destructive when the profile's purge options are enabled.
seeder/download-templates [--overwrite] [--dry-run] [--template-registry=<url>]Downloads template dataset packs into the plugin's data/ directory.

Shared options where relevant: --yes (skip confirmations), --non-interactive, --profile=<handle>, --validate, --dry-run, --locale=<locale>, --seed=<n>, --batch-size=<n>, --concurrency=<n>.

See Console Commands for the full per-command option/argument reference, exit codes, and examples.

Cron (CronController, registered as seeder-cron)

CommandPurpose
seeder-cron/run [<profile-handle>]Runs all enabled profiles with a cron schedule, or one specific profile by handle.
seeder-cron/listLists profiles with their cron schedules and last-run status.

Import (ImportController, registered as seeder-import)

CommandPurpose
seeder-import/run --profile=<handle> [--file=<path>] [--queue]Runs a saved import profile. --file overrides the profile's source file (absolute, or relative to @storage/seeder-imports). --queue dispatches a yui\seeder\jobs\ImportJob instead of running inline.
seeder-import/listLists saved import profiles.

CP routes

Registered on UrlManager::EVENT_REGISTER_CP_URL_RULES in Plugin.php:

RoutePurpose
seeder, seeder/profilesGenerator profile list
seeder/profiles/new, seeder/profiles/<id>Generator profile create/edit
seeder/profiles/generate, seeder/profiles/bulk-generate, seeder/profiles/dry-runRun a profile (or several), or preview without writing
seeder/profiles/duplicate, seeder/profiles/set-status, seeder/profiles/deleteProfile management
seeder/run-log/<id>Generator run log detail
seeder/import, seeder/import/new, seeder/import/<id>Import profile list/create/edit (the wizard)
seeder/import/upload, seeder/import/preview-columns, seeder/import/detect-pathsImport wizard source/mapping steps (AJAX)
seeder/import/sections, seeder/import/entry-fields, seeder/import/relation-sub-fieldsImport wizard target-field discovery for entries (AJAX)
seeder/import/run, seeder/import/save, seeder/import/deleteImport profile actions
seeder/import-logs, seeder/import-logs/<id>Import log list/detail
seeder/import-logs/delete, seeder/import-logs/delete-allImport log cleanup
seeder/settingsPlugin settings
seeder/license/*License activation/redeem/revoke panel, shared with the rest of the ecosystem

Services

Registered as components on the Plugin instance (Plugin::getInstance()->get('<name>')):

ComponentClassKey methods
profilesProfileServicegetAllProfiles(), getEnabledProfiles(), getProfileById(), getProfileByHandle(), saveProfile(SeederProfile $profile, bool $runValidation = true), deleteProfileById(), duplicateProfile()
profileConfigProfileConfigServiceBuilds/normalizes the per-entity generator config stored on a SeederProfile.
runLogRunLogServicePersists and queries SeederRunLog records for generator runs.
dataServiceSeederDataServiceReads the bundled JSON datasets under data/ (brands, categories, customers, payments, shipping).
storeResolverStoreResolverResolves the yStore plugin's customer/product/order services and models across yStore versions.
importProfilesImportProfileServicegetAllProfiles(), getProfileById(), getProfileByHandle(), saveProfile(ImportProfile $profile), deleteProfile()
importSourceSourceServicegetParser($format), fetchRows($profile), saveUpload(), detectColumns(), previewRows(), detectDataPaths() — dispatches to the CSV/JSON/XML ParserInterface implementation for the profile's fileFormat.
importerImportServicerun(ImportProfile $profile, string $trigger = ImportLog::TRIGGER_CP, ?string $overrideFilePath = null, ?callable $progressCallback = null): ImportLog — runs a full import and returns the finished log.
importLogImportLogServiceStarts/updates ImportLog/ImportLogItem records for both CP and CLI-triggered imports.
licenseLicenseServiceLicense activation/validation, shared with the rest of the yStore ecosystem.

ImportProfile::$elementType is one of product, entry, category, customer; $sourceType is file or url; $fileFormat is csv, json, or xml. Import row parsing goes through yui\seeder\importers\parsers\{Csv,Json,Xml}Parser, all implementing ParserInterface::parse()/detectColumns()/preview().

Extending

  • New generator entity type — add a trait under src/traits/ (see ProductSeederTrait, CustomerSeederTrait, OrderSeederTrait, CouponSeederTrait, GiftCardSeederTrait, CatalogRuleSeederTrait, WishlistSeederTrait for the pattern), wire it into GeneratorController and the profile config schema in ProfileConfigService.
  • New import source format — implement ParserInterface and register it in SourceService::getParser().
  • New import target field type — extend ProductMapper (or add a sibling mapper for entries/categories/customers) and the target-field discovery routes used by the import wizard's Mapping step.