Go to the source code of this file.
◆ createComments()
| Elgg\Traits\createComments |
( |
\ElggEntity |
$entity, |
|
|
|
$limit = null |
|
) |
| |
Create comments/replies.
- Parameters
-
| \ElggEntity | $entity | Entity to comment on |
| int | $limit | Number of comments to create |
- Returns
- int Number of generated comments
Definition at line 813 of file Seeding.php.
◆ createIcon()
Create an icon for an entity.
- Parameters
-
- Returns
- bool
Definition at line 778 of file Seeding.php.
◆ createLikes()
| Elgg\Traits\createLikes |
( |
\ElggEntity |
$entity, |
|
|
|
$limit = null |
|
) |
| |
Create likes.
- Parameters
-
| \ElggEntity | $entity | Entity to like |
| int | $limit | Number of likes to create |
- Returns
- int
Definition at line 858 of file Seeding.php.
◆ createObject()
| Elgg\Traits\createObject |
( |
array |
$properties = [], |
|
|
array |
$options = [] |
|
) |
| |
Create a new fake object.
- Parameters
-
| array | $properties | Entity attributes/metadata |
| array | $options | Additional options |
- Returns
- \ElggObject
- Exceptions
-
Definition at line 381 of file Seeding.php.
◆ createSite()
| Elgg\Traits\createSite |
( |
array |
$properties = [] | ) |
|
Create a new fake site.
- Parameters
-
| array | $properties | Entity attributes/metadata |
- Returns
- \ElggSite
Definition at line 507 of file Seeding.php.
◆ faker()
| Elgg\Traits\faker |
( |
string |
$locale = 'en_US' | ) |
|
Returns an instance of faker.
- Parameters
-
- Returns
- \Faker\Generator
Definition at line 47 of file Seeding.php.
◆ getDomain()
| Elgg\Traits\getDomain |
( |
| ) |
|
Get site domain.
- Returns
- string
Definition at line 62 of file Seeding.php.
◆ getEmailDomain()
| Elgg\Traits\getEmailDomain |
( |
| ) |
|
Get valid domain for emails.
- Returns
- string
Definition at line 71 of file Seeding.php.
◆ getRandomAccessId()
Get random access id.
- Parameters
-
| null | \ElggUser | $user | User |
| null | \ElggEntity | $container | Container |
- Returns
- int
Definition at line 616 of file Seeding.php.
◆ getRandomEmail()
| Elgg\Traits\getRandomEmail |
( |
|
$base = null | ) |
|
Generate a random valid email.
- Parameters
-
| string | $base | Email username part |
- Returns
- string
Definition at line 665 of file Seeding.php.
◆ getRandomGroup()
| Elgg\Traits\getRandomGroup |
( |
array |
$exclude = [], |
|
|
bool |
$allow_create = true |
|
) |
| |
Returns random fake group.
- Parameters
-
| int[] | $exclude | GUIDs to exclude |
| bool | $allow_create | If no existing random group could be found create a new group (default: true) |
- Returns
- \ElggGroup|false
Definition at line 568 of file Seeding.php.
◆ getRandomSubtype()
| Elgg\Traits\getRandomSubtype |
( |
| ) |
|
Returns random unique subtype.
- Returns
- string
Definition at line 91 of file Seeding.php.
◆ getRandomUser()
| Elgg\Traits\getRandomUser |
( |
array |
$exclude = [], |
|
|
bool |
$allow_create = true |
|
) |
| |
Returns random fake user.
- Parameters
-
| int[] | $exclude | GUIDs to exclude |
| bool | $allow_create | If no existing random user could be found create a new user (default: true) |
- Returns
- \ElggUser|false
Definition at line 520 of file Seeding.php.
◆ getRandomUsername()
| Elgg\Traits\getRandomUsername |
( |
|
$name = null | ) |
|
Generates a unique available and valid username.
- Parameters
-
| string | $name | Display name or other prefix to use as basis |
- Returns
- string
Definition at line 631 of file Seeding.php.
◆ log()
| Elgg\Traits\log |
( |
|
$msg, |
|
|
|
$level = LogLevel::NOTICE |
|
) |
| |
Log a message.
- Parameters
-
| string | $msg | Message to log |
| string | $level | Message level |
- Returns
- void
Definition at line 889 of file Seeding.php.
◆ populateMetadata()
| Elgg\Traits\populateMetadata |
( |
\ElggEntity |
$entity, |
|
|
array |
$fields = [], |
|
|
array |
$metadata = [] |
|
) |
| |
Set random metadata.
- Parameters
-
| \ElggEntity | $entity | Entity |
| array | $fields | An array of profile fields in $name => $input_type format |
| array | $metadata | Other metadata $name => $value pairs to set |
- Returns
- \ElggEntity
Definition at line 698 of file Seeding.php.
◆ $faker
◆ $MAX_ATTEMPTS
| Elgg::Traits\$MAX_ATTEMPTS = 10 |
|
protected |
◆ Seeding
| trait Elgg::Traits\Seeding |
Initial value:{
trait GroupHelpers
Group helpers for seeding.
Seeding trait Can be used to easily create new random users, groups and objects in the database.
Definition at line 23 of file Seeding.php.