Elgg  Version 2.3
TimeUsing.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg;
3 
5 
11 trait TimeUsing {
12 
16  private $time;
17 
26  public function getCurrentTime($modifier = '') {
27  $time = $this->time ? $this->time : new DateTime();
28  $time = clone $time;
29  if ($modifier) {
30  $time->modify($modifier);
31  }
32  return $time;
33  }
34 
41  public function setCurrentTime(DateTime $time = null) {
42  if (!$time) {
43  $time = new DateTime();
44  }
45  $this->time = clone $time;
46  }
47 }
getCurrentTime($modifier= '')
Get the (cloned) time.
Definition: TimeUsing.php:26
Save menu items.
elgg subtext time
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:5
setCurrentTime(DateTime $time=null)
Set the current time.
Definition: TimeUsing.php:41