Elgg  Version 4.3
Public Member Functions | Protected Attributes | List of all members
Elgg\Database\Seeder Class Reference

Seeder class. More...

Public Member Functions

 __construct (PluginHooksService $hooks, Progress $progress, Invoker $invoker)
 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...
 

Protected Attributes

 $hooks
 
 $progress
 
 $invoker
 

Detailed Description

Seeder class.

Populates the database with rows for testing

Definition at line 17 of file Seeder.php.

Constructor & Destructor Documentation

Elgg\Database\Seeder::__construct ( PluginHooksService  $hooks,
Progress  $progress,
Invoker  $invoker 
)

Seeder constructor.

Parameters
PluginHooksService$hooksHooks registration service
Progress$progressProgress helper
Invoker$invokerInvoker service

Definition at line 41 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 146 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 64 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 112 of file Seeder.php.

Member Data Documentation

Elgg\Database\Seeder::$hooks
protected

Definition at line 22 of file Seeder.php.

Elgg\Database\Seeder::$invoker
protected

Definition at line 32 of file Seeder.php.

Elgg\Database\Seeder::$progress
protected

Definition at line 27 of file Seeder.php.


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