Piwik\Tracker\Request::getCurrentTimestamp PHP Method

getCurrentTimestamp() public method

public getCurrentTimestamp ( )
    public function getCurrentTimestamp()
    {
        if (!isset($this->cdtCache)) {
            $this->cdtCache = $this->getCustomTimestamp();
        }
        if (!empty($this->cdtCache)) {
            return $this->cdtCache;
        }
        return $this->timestamp;
    }

Usage Example

Example #1
0
 /**
  * @param Request $request
  * @param Visitor $visitor
  * @param Action|null $action
  * @return mixed
  */
 public function onExistingVisit(Request $request, Visitor $visitor, $action)
 {
     $firstActionTime = $visitor->getVisitorColumn('visit_first_action_time');
     $totalTime = 1 + $request->getCurrentTimestamp() - $firstActionTime;
     $totalTime = $this->cleanupVisitTotalTime($totalTime);
     return $totalTime;
 }
All Usage Examples Of Piwik\Tracker\Request::getCurrentTimestamp