ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sspmod_statistics_DateHandler Class Reference
+ Inheritance diagram for sspmod_statistics_DateHandler:
+ Collaboration diagram for sspmod_statistics_DateHandler:

Public Member Functions

 __construct ($offset)
 Constructor. More...
 
 toSlot ($epoch, $slotsize)
 
 fromSlot ($slot, $slotsize)
 
 prettyDateEpoch ($epoch, $dateformat)
 
 prettyDateSlot ($slot, $slotsize, $dateformat)
 
 prettyHeader ($from, $to, $slotsize, $dateformat)
 

Protected Member Functions

 getDST ($timestamp)
 

Protected Attributes

 $offset
 

Detailed Description

Definition at line 6 of file DateHandler.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_statistics_DateHandler::__construct (   $offset)

Constructor.

Parameters
array$offsetDate offset

Definition at line 15 of file DateHandler.php.

References $offset.

16  {
17  $this->offset = $offset;
18  }

Member Function Documentation

◆ fromSlot()

sspmod_statistics_DateHandler::fromSlot (   $slot,
  $slotsize 
)

Definition at line 34 of file DateHandler.php.

References $dst, $offset, and getDST().

Referenced by prettyDateSlot().

35  {
36  $temp = $slot*$slotsize - $this->offset;
37  $dst = $this->getDST($temp);
38  return $slot*$slotsize - $this->offset - $dst;
39  }
$dst
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDST()

sspmod_statistics_DateHandler::getDST (   $timestamp)
protected

Definition at line 20 of file DateHandler.php.

References $timestamp.

Referenced by fromSlot(), sspmod_statistics_DateHandlerMonth\toSlot(), and toSlot().

21  {
22  if (idate('I', $timestamp)) {
23  return 3600;
24  }
25  return 0;
26  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ Here is the caller graph for this function:

◆ prettyDateEpoch()

sspmod_statistics_DateHandler::prettyDateEpoch (   $epoch,
  $dateformat 
)

Definition at line 41 of file DateHandler.php.

Referenced by prettyDateSlot().

42  {
43  return date($dateformat, $epoch);
44  }
+ Here is the caller graph for this function:

◆ prettyDateSlot()

sspmod_statistics_DateHandler::prettyDateSlot (   $slot,
  $slotsize,
  $dateformat 
)

Definition at line 46 of file DateHandler.php.

References fromSlot(), and prettyDateEpoch().

Referenced by prettyHeader().

47  {
48  return $this->prettyDateEpoch($this->fromSlot($slot, $slotsize), $dateformat);
49  }
fromSlot($slot, $slotsize)
Definition: DateHandler.php:34
prettyDateEpoch($epoch, $dateformat)
Definition: DateHandler.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prettyHeader()

sspmod_statistics_DateHandler::prettyHeader (   $from,
  $to,
  $slotsize,
  $dateformat 
)

Definition at line 51 of file DateHandler.php.

References $from, $text, and prettyDateSlot().

Referenced by sspmod_statistics_Statistics_Rulesets_BaseRule\availableFileSlots().

52  {
53  $text = $this->prettyDateSlot($from, $slotsize, $dateformat);
54  $text .= ' to ';
55  $text .= $this->prettyDateSlot($to, $slotsize, $dateformat);
56  return $text;
57  }
$from
prettyDateSlot($slot, $slotsize, $dateformat)
Definition: DateHandler.php:46
$text
Definition: errorreport.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toSlot()

sspmod_statistics_DateHandler::toSlot (   $epoch,
  $slotsize 
)

Definition at line 28 of file DateHandler.php.

References $dst, and getDST().

29  {
30  $dst = $this->getDST($epoch);
31  return floor( ($epoch + $this->offset + $dst) / $slotsize);
32  }
$dst
+ Here is the call graph for this function:

Field Documentation

◆ $offset

sspmod_statistics_DateHandler::$offset
protected

The documentation for this class was generated from the following file: