Elgg  Version 6.2
Functions | Variables
TimeUsing.php File Reference

Go to the source code of this file.

Functions

 Elgg\Traits::getCurrentTime ($modifier='')
 Get the (cloned) time. More...
 
 Elgg\Traits::setCurrentTime (?\DateTime $time=null)
 Set the current time. More...
 
 Elgg\Traits::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 Elgg\Traits::TimeUsing
 Adds methods for setting the current time (for testing) More...
 

Function Documentation

◆ getCurrentTime()

Elgg\Traits\getCurrentTime (   $modifier = '')

Get the (cloned) time.

If setCurrentTime() has not been set, this will return a new DateTime().

Parameters
string$modifierTime modifier
Returns
\DateTime
See also
\DateTime::modify

Definition at line 25 of file TimeUsing.php.

◆ resetCurrentTime()

Elgg\Traits\resetCurrentTime ( )

Reset the current time Use after the time has been set with setCurrentTime and it no longer needs to be locked.

Returns
void
Since
4.3

Definition at line 54 of file TimeUsing.php.

◆ setCurrentTime()

Elgg\Traits\setCurrentTime ( ?\DateTime  $time = null)

Set the current time.

Parameters
null | \DateTime$timeCurrent time (empty for now)
Returns
void

Definition at line 42 of file TimeUsing.php.

Variable Documentation

◆ TimeUsing

trait Elgg::Traits\TimeUsing
Initial value:
{
private $time
if(! $annotation instanceof ElggAnnotation) $time
Definition: time.php:20

Adds methods for setting the current time (for testing)

Definition at line 10 of file TimeUsing.php.