Elgg
Version 3.0
|
Namespaces | |
Providers | |
Classes | |
class | Groups |
Seed users. More... | |
class | Seed |
Abstract seed. More... | |
interface | Seedable |
Provides seedable methods for database seeding and unit tests. More... | |
class | Users |
Seed users. More... | |
Functions | |
faker ($locale= 'en_US') | |
Returns an instance of faker. More... | |
getDomain () | |
Get site domain. More... | |
getEmailDomain () | |
Get valid domain for emails. More... | |
getRandomSubtype () | |
Returns random unique subtype. More... | |
createUser (array $attributes=[], array $metadata=[], array $options=[]) | |
Create a new fake user. More... | |
createGroup (array $attributes=[], array $metadata=[], array $options=[]) | |
Create a new fake group. More... | |
createObject (array $attributes=[], array $metadata=[], array $options=[]) | |
Create a new fake object. More... | |
createSite (array $attributes=[], array $metadata=[]) | |
Create a new fake site. 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 ($name=null) | |
Generates a unique available and valid username. More... | |
getRandomEmail ($base=null) | |
Generate a random valid email. 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=LogLevel::NOTICE) | |
Log a message. More... | |
Variables | |
trait | Seeding |
Seeding trait Can be used to easily create new random users, groups and objects in the database. More... | |
$faker | |
Elgg\Database\Seeds\createComments | ( | ElggEntity | $entity, |
$limit = null |
|||
) |
Create comments/replies.
ElggEntity | $entity | Entity to comment on |
int | $limit | Number of comments to create |
Definition at line 695 of file Seeding.php.
Elgg\Database\Seeds\createGroup | ( | array | $attributes = [] , |
array | $metadata = [] , |
||
array | $options = [] |
||
) |
Create a new fake group.
array | $attributes | Group entity attributes |
array | $metadata | Group entity metadata |
array | $options | Additional options |
Definition at line 206 of file Seeding.php.
Elgg\Database\Seeds\createIcon | ( | ElggEntity | $entity | ) |
Create an icon for an entity.
ElggEntity | $entity | Entity |
Definition at line 666 of file Seeding.php.
Elgg\Database\Seeds\createLikes | ( | ElggEntity | $entity, |
$limit = null |
|||
) |
Create likes.
ElggEntity | $entity | Entity to like |
int | $limit | Number of likes to create |
Definition at line 732 of file Seeding.php.
Elgg\Database\Seeds\createObject | ( | array | $attributes = [] , |
array | $metadata = [] , |
||
array | $options = [] |
||
) |
Create a new fake object.
array | $attributes | Object entity attributes |
array | $metadata | Object entity metadata |
array | $options | Additional options |
Definition at line 328 of file Seeding.php.
Elgg\Database\Seeds\createSite | ( | array | $attributes = [] , |
array | $metadata = [] |
||
) |
Create a new fake site.
array | $attributes | Object entity attributes |
array | $metadata | Object entity metadata |
Definition at line 430 of file Seeding.php.
Elgg\Database\Seeds\createUser | ( | array | $attributes = [] , |
array | $metadata = [] , |
||
array | $options = [] |
||
) |
Create a new fake user.
array | $attributes | User entity attributes |
array | $metadata | User entity metadata |
array | $options | Seeding options |
Definition at line 97 of file Seeding.php.
Elgg\Database\Seeds\faker | ( | $locale = 'en_US' | ) |
Returns an instance of faker.
string | $locale | Locale |
Definition at line 43 of file Seeding.php.
Elgg\Database\Seeds\getDomain | ( | ) |
Elgg\Database\Seeds\getEmailDomain | ( | ) |
Elgg\Database\Seeds\getRandomAccessId | ( | \ElggUser | $user = null , |
ElggEntity | $container = null |
||
) |
Get random access id.
ElggUser | $user | User |
ElggEntity | $container | Container |
Definition at line 495 of file Seeding.php.
Elgg\Database\Seeds\getRandomEmail | ( | $base = null | ) |
Generate a random valid email.
string | $base | Email username part |
Definition at line 548 of file Seeding.php.
Elgg\Database\Seeds\getRandomGroup | ( | array | $exclude = [] | ) |
Returns random fake group.
int[] | $exclude GUIDs to exclude |
Definition at line 468 of file Seeding.php.
Elgg\Database\Seeds\getRandomSubtype | ( | ) |
Elgg\Database\Seeds\getRandomUser | ( | array | $exclude = [] | ) |
Returns random fake user.
int[] | $exclude GUIDs to exclude |
Definition at line 442 of file Seeding.php.
Elgg\Database\Seeds\getRandomUsername | ( | $name = null | ) |
Generates a unique available and valid username.
string | $name | Display name or other prefix to use as basis |
Definition at line 515 of file Seeding.php.
Elgg\Database\Seeds\log | ( | $msg, | |
$level = LogLevel::NOTICE |
|||
) |
Log a message.
string | $msg | Message to log |
string | $level | Message level Note that 'ERROR' will terminate further code execution |
Definition at line 762 of file Seeding.php.
Elgg\Database\Seeds\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 581 of file Seeding.php.
|
protected |
Definition at line 34 of file Seeding.php.
trait Elgg::Database::Seeds\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.