Elgg
Version 6.1
|
Namespaces | |
Cli | |
Database | |
Debug | |
Di | |
Entity | |
Notifications | |
Seeding | |
Functions | |
setLogger (LoggerInterface $logger=null) | |
Set (or remove) the logger. More... | |
getLogger () | |
Returns logger. More... | |
log ($level, $message, array $context=[]) | |
Log a message. More... | |
logDeprecatedMessage (string $message, string $version) | |
Sends a message about deprecated use of a function, view, etc. More... | |
faker (string $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 $properties=[], array $options=[]) | |
Create a new fake user. More... | |
createGroup (array $properties=[], array $options=[]) | |
Create a new fake group. More... | |
createObject (array $properties=[], array $options=[]) | |
Create a new fake object. More... | |
createSite (array $properties=[]) | |
Create a new fake site. More... | |
getRandomUser (array $exclude=[], bool $allow_create=true) | |
Returns random fake user. More... | |
getRandomGroup (array $exclude=[], bool $allow_create=true) | |
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... | |
getCurrentTime ($modifier= '') | |
Get the (cloned) time. More... | |
setCurrentTime (\DateTime $time=null) | |
Set the current time. More... | |
resetCurrentTime () | |
Reset the current time Use after the time has been set with setCurrentTime and it no longer needs to be locked. More... | |
Variables | |
trait | Loggable |
Enables adding a logger. More... | |
trait | Seeding |
Seeding trait Can be used to easily create new random users, groups and objects in the database. More... | |
$MAX_ATTEMPTS = 10 | |
$faker | |
trait | TimeUsing |
Adds methods for setting the current time (for testing) More... | |
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.
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\getCurrentTime | ( | $modifier = '' | ) |
Get the (cloned) time.
If setCurrentTime() has not been set, this will return a new DateTime().
string | $modifier | Time modifier |
Definition at line 25 of file TimeUsing.php.
Elgg\Traits\getDomain | ( | ) |
Elgg\Traits\getEmailDomain | ( | ) |
Elgg\Traits\getLogger | ( | ) |
Elgg\Traits\getRandomAccessId | ( | \ElggUser | $user = null , |
\ElggEntity | $container = null |
||
) |
Get random access id.
\ElggUser | $user | User |
\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 | ( | $level, | |
$message, | |||
array | $context = [] |
||
) |
Log a message.
string | $level | Severity |
mixed | $message | Message |
array | $context | Context |
Definition at line 58 of file Loggable.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\logDeprecatedMessage | ( | string | $message, |
string | $version | ||
) |
Sends a message about deprecated use of a function, view, etc.
string | $message | Message to log |
string | $version | Human-readable release version: 1.7, 1.8, ... |
Definition at line 76 of file Loggable.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.
Elgg\Traits\resetCurrentTime | ( | ) |
Reset the current time Use after the time has been set with setCurrentTime and it no longer needs to be locked.
Definition at line 54 of file TimeUsing.php.
Elgg\Traits\setCurrentTime | ( | \DateTime | $time = null | ) |
Set the current time.
\DateTime | $time | Current time (empty for now) |
Definition at line 42 of file TimeUsing.php.
Elgg\Traits\setLogger | ( | LoggerInterface | $logger = null | ) |
Set (or remove) the logger.
LoggerInterface | $logger | Logger or null |
Definition at line 28 of file Loggable.php.
|
protected |
Definition at line 39 of file Seeding.php.
|
protected |
Definition at line 34 of file Seeding.php.
trait Elgg::Traits\Loggable |
Enables adding a logger.
Users should not assume $this->logger is set: use Loggable::getLogger()
Definition at line 14 of file Loggable.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.
trait Elgg::Traits\TimeUsing |
Adds methods for setting the current time (for testing)
Definition at line 10 of file TimeUsing.php.