Elgg  Version 6.1
Public Member Functions | List of all members
Elgg\Database\Seeder Class Reference

Seeder class. More...

Public Member Functions

 __construct (protected EventsService $events, protected Progress $progress, protected Invoker $invoker, protected Translator $translator, protected Config $config)
 Seeder constructor. More...
 
 seed (array $options=[])
 Load seed scripts. More...
 
 unseed (array $options=[])
 Remove all seeded entities. More...
 
 getSeederClasses ()
 Get the class names of all registered seeders (verified to work for seeding) More...
 

Detailed Description

Seeder class.

Populates the database with rows for testing

Definition at line 20 of file Seeder.php.

Constructor & Destructor Documentation

Elgg\Database\Seeder::__construct ( protected EventsService  $events,
protected Progress  $progress,
protected Invoker  $invoker,
protected Translator  $translator,
protected Config  $config 
)

Seeder constructor.

Parameters
EventsService$eventsEvents service
Progress$progressProgress helper
Invoker$invokerInvoker service
Translator$translatorTranslator
Config$configElgg config

Definition at line 31 of file Seeder.php.

Member Function Documentation

Elgg\Database\Seeder::getSeederClasses ( )

Get the class names of all registered seeders (verified to work for seeding)

Returns
string[]

Definition at line 164 of file Seeder.php.

Elgg\Database\Seeder::seed ( array  $options = [])

Load seed scripts.

Parameters
array$optionsoptions for seeding
  • limit: the max number of entities to seed
  • image_folder: a global (local) image folder to use for image seeding (user/group profile icon, etc)
  • type: only seed this content type
  • create: create new entities (default: false)
  • create_since: lower bound creation time (default: now)
  • create_until: upper bound creation time (default: now)
Returns
void

Definition at line 53 of file Seeder.php.

Elgg\Database\Seeder::unseed ( array  $options = [])

Remove all seeded entities.

Parameters
array$optionsunseeding options
  • type: only unseed this content type
Returns
void

Definition at line 124 of file Seeder.php.


The documentation for this class was generated from the following file: