Elgg
Version 3.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
TimeUsing.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg
;
4
5
use
DateTime
;
6
12
trait
TimeUsing
{
13
17
private
$time
;
18
27
public
function
getCurrentTime
($modifier =
''
) {
28
$time
= $this->time ? $this->time :
new
DateTime
();
29
$time
= clone
$time
;
30
if
($modifier) {
31
$time->modify($modifier);
32
}
33
return
$time
;
34
}
35
42
public
function
setCurrentTime
(
DateTime
$time
= null) {
43
if
(!
$time
) {
44
$time
=
new
DateTime
();
45
}
46
$this->time = clone
$time
;
47
}
48
}
DateTime
Elgg\getCurrentTime
getCurrentTime($modifier= '')
Get the (cloned) time.
Definition:
TimeUsing.php:27
Elgg
Configuration exception.
$time
if(!$entity instanceof ElggEntity) $time
Definition:
time.php:21
TimeUsing
Elgg\setCurrentTime
setCurrentTime(DateTime $time=null)
Set the current time.
Definition:
TimeUsing.php:42
Generated on Sat Jan 16 2021 00:00:25 for Elgg by
1.8.11