Elgg
Version master
|
Go to the source code of this file.
Functions | |
Elgg\Traits::faker (string $locale='en_US') | |
Returns an instance of faker. More... | |
Elgg\Traits::getDomain () | |
Get site domain. More... | |
Elgg\Traits::getEmailDomain () | |
Get valid domain for emails. More... | |
Elgg\Traits::getRandomSubtype () | |
Returns random unique subtype. More... | |
Elgg\Traits::createUser (array $properties=[], array $options=[]) | |
Create a new fake user. More... | |
Elgg\Traits::createGroup (array $properties=[], array $options=[]) | |
Create a new fake group. More... | |
Elgg\Traits::createObject (array $properties=[], array $options=[]) | |
Create a new fake object. More... | |
Elgg\Traits::createSite (array $properties=[]) | |
Create a new fake site. More... | |
Elgg\Traits::getRandomUser (array $exclude=[], bool $allow_create=true) | |
Returns random fake user. More... | |
Elgg\Traits::getRandomGroup (array $exclude=[], bool $allow_create=true) | |
Returns random fake group. More... | |
Elgg\Traits::getRandomAccessId (?\ElggUser $user=null, ?\ElggEntity $container=null) | |
Get random access id. More... | |
Elgg\Traits::getRandomUsername ($name=null) | |
Generates a unique available and valid username. More... | |
Elgg\Traits::getRandomEmail ($base=null) | |
Generate a random valid email. More... | |
Elgg\Traits::populateMetadata (\ElggEntity $entity, array $fields=[], array $metadata=[]) | |
Set random metadata. More... | |
Elgg\Traits::createIcon (\ElggEntity $entity) | |
Create an icon for an entity. More... | |
Elgg\Traits::createComments (\ElggEntity $entity, $limit=null) | |
Create comments/replies. More... | |
Elgg\Traits::createLikes (\ElggEntity $entity, $limit=null) | |
Create likes. More... | |
Elgg\Traits::log ($msg, $level=LogLevel::NOTICE) | |
Log a message. More... | |
Variables | |
trait | Elgg\Traits::Seeding |
Seeding trait Can be used to easily create new random users, groups and objects in the database. More... | |
Elgg\Traits::$MAX_ATTEMPTS = 10 | |
Elgg\Traits::$faker | |
Elgg\Traits\createComments | ( | \ElggEntity | $entity, |
$limit = null |
|||
) |
Create comments/replies.
\ElggEntity | $entity | Entity to comment on |
int | $limit | Number of comments to create |
Definition at line 814 of file Seeding.php.
Elgg\Traits\createGroup | ( | array | $properties = [] , |
array | $options = [] |
||
) |
Create a new fake group.
array | $properties | Entity attributes/metadata |
array | $options | Additional options |
MaxAttemptsException |
Definition at line 240 of file Seeding.php.
Elgg\Traits\createIcon | ( | \ElggEntity | $entity | ) |
Create an icon for an entity.
\ElggEntity | $entity | Entity |
Definition at line 779 of file Seeding.php.
Elgg\Traits\createLikes | ( | \ElggEntity | $entity, |
$limit = null |
|||
) |
Create likes.
\ElggEntity | $entity | Entity to like |
int | $limit | Number of likes to create |
Definition at line 859 of file Seeding.php.
Elgg\Traits\createObject | ( | array | $properties = [] , |
array | $options = [] |
||
) |
Create a new fake object.
array | $properties | Entity attributes/metadata |
array | $options | Additional options |
MaxAttemptsException |
Definition at line 382 of file Seeding.php.
Elgg\Traits\createSite | ( | array | $properties = [] | ) |
Create a new fake site.
array | $properties | Entity attributes/metadata |
Definition at line 508 of file Seeding.php.
Elgg\Traits\createUser | ( | array | $properties = [] , |
array | $options = [] |
||
) |
Create a new fake user.
array | $properties | Entity attributes/metadata |
array | $options | Seeding options |
MaxAttemptsException |
Definition at line 105 of file Seeding.php.
Elgg\Traits\faker | ( | string | $locale = 'en_US' | ) |
Returns an instance of faker.
string | $locale | Locale |
Definition at line 48 of file Seeding.php.
Elgg\Traits\getDomain | ( | ) |
Elgg\Traits\getEmailDomain | ( | ) |
Elgg\Traits\getRandomAccessId | ( | ?\ElggUser | $user = null , |
?\ElggEntity | $container = null |
||
) |
Get random access id.
null | \ElggUser | $user | User |
null | \ElggEntity | $container | Container |
Definition at line 617 of file Seeding.php.
Elgg\Traits\getRandomEmail | ( | $base = null | ) |
Generate a random valid email.
string | $base | Email username part |
Definition at line 666 of file Seeding.php.
Elgg\Traits\getRandomGroup | ( | array | $exclude = [] , |
bool | $allow_create = true |
||
) |
Returns random fake group.
int[] | $exclude | GUIDs to exclude |
bool | $allow_create | If no existing random group could be found create a new group (default: true) |
Definition at line 569 of file Seeding.php.
Elgg\Traits\getRandomSubtype | ( | ) |
Elgg\Traits\getRandomUser | ( | array | $exclude = [] , |
bool | $allow_create = true |
||
) |
Returns random fake user.
int[] | $exclude | GUIDs to exclude |
bool | $allow_create | If no existing random user could be found create a new user (default: true) |
Definition at line 521 of file Seeding.php.
Elgg\Traits\getRandomUsername | ( | $name = null | ) |
Generates a unique available and valid username.
string | $name | Display name or other prefix to use as basis |
Definition at line 632 of file Seeding.php.
Elgg\Traits\log | ( | $msg, | |
$level = LogLevel::NOTICE |
|||
) |
Log a message.
string | $msg | Message to log |
string | $level | Message level |
Definition at line 890 of file Seeding.php.
Elgg\Traits\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 |
Definition at line 699 of file Seeding.php.
|
protected |
Definition at line 39 of file Seeding.php.
|
protected |
Definition at line 34 of file Seeding.php.
trait Elgg::Traits\Seeding |
Seeding trait Can be used to easily create new random users, groups and objects in the database.
Definition at line 24 of file Seeding.php.