Elgg
Version 2.3
|
Abstract seed. More...
Public Member Functions | |
__construct ($locale= 'en_US') | |
Seed constructor. More... | |
seed () | |
Populate database. More... | |
unseed () | |
Removed seeded rows from database. More... | |
getDomain () | |
Get site domain. More... | |
createUser (array $attributes=[], array $metadata=[]) | |
Create a new faker user. More... | |
createGroup (array $attributes=[], array $metadata=[]) | |
Create a new faker group. More... | |
createObject (array $attributes=[], array $metadata=[]) | |
Create a new faker object. More... | |
getRandomUser (array $exclude=[]) | |
Returns random fake user. More... | |
getRandomGroup (array $exclude=[]) | |
Returns random fake group. More... | |
getRandomAccessId (\ElggUser $user=null, ElggEntity $container=null) | |
Get random access id. More... | |
getRandomUsername ($base_name= 'user') | |
Generates a unique available and valid username. More... | |
populateMetadata (ElggEntity $entity, array $fields=[], array $metadata=[]) | |
Set random metadata. More... | |
createIcon (ElggEntity $entity) | |
Create an icon for an entity. More... | |
createComments (ElggEntity $entity, $limit=null) | |
Create comments/replies. More... | |
createLikes (ElggEntity $entity, $limit=null) | |
Create likes. More... | |
log ($msg, $level= 'NOTICE') | |
Log a message. More... | |
Protected Attributes | |
$limit = 3 | |
$faker | |
Abstract seed.
Plugins should extend this class to create their own seeders, add use 'seeds','database' plugin hook to add their seed to the sequence.
Elgg\Database\Seeds\Seed::__construct | ( | $locale = 'en_US' | ) |
Elgg\Database\Seeds\Seed::createComments | ( | ElggEntity | $entity, |
$limit = null |
|||
) |
Create comments/replies.
ElggEntity | $entity | Entity to comment on |
int | $limit | Number of comments to create |
Elgg\Database\Seeds\Seed::createGroup | ( | array | $attributes = [] , |
array | $metadata = [] |
||
) |
Elgg\Database\Seeds\Seed::createIcon | ( | ElggEntity | $entity | ) |
Elgg\Database\Seeds\Seed::createLikes | ( | ElggEntity | $entity, |
$limit = null |
|||
) |
Create likes.
ElggEntity | $entity | Entity to like |
int | $limit | Number of likes to create |
Elgg\Database\Seeds\Seed::createObject | ( | array | $attributes = [] , |
array | $metadata = [] |
||
) |
Elgg\Database\Seeds\Seed::createUser | ( | array | $attributes = [] , |
array | $metadata = [] |
||
) |
Elgg\Database\Seeds\Seed::getDomain | ( | ) |
Elgg\Database\Seeds\Seed::getRandomAccessId | ( | \ElggUser | $user = null , |
ElggEntity | $container = null |
||
) |
Elgg\Database\Seeds\Seed::getRandomGroup | ( | array | $exclude = [] | ) |
Elgg\Database\Seeds\Seed::getRandomUser | ( | array | $exclude = [] | ) |
Elgg\Database\Seeds\Seed::getRandomUsername | ( | $base_name = 'user' | ) |
Elgg\Database\Seeds\Seed::log | ( | $msg, | |
$level = 'NOTICE' |
|||
) |
Elgg\Database\Seeds\Seed::populateMetadata | ( | ElggEntity | $entity, |
array | $fields = [] , |
||
array | $metadata = [] |
||
) |
Set random metadata.
ElggEntity | $entity | Entity |
array | $fields | An array of profile fields in $name => $input_type format |
array | $metadata | Other metadata $name => $value pairs to set |
|
abstract |
Populate database.
|
abstract |
Removed seeded rows from database.