| Server IP : 23.94.149.180 / Your IP : 216.73.216.147 Web Server : nginx/1.20.1 System : Linux deadrock 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 15:18:14 UTC 2026 x86_64 User : apache ( 48) PHP Version : 8.6.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /files/www/annepeterswordsmith/wp-content/plugins/wp-statistics/src/Decorators/ |
Upload File : |
<?php
namespace WP_Statistics\Decorators;
use WP_Statistics\Components\DateTime;
use WP_Statistics\Decorators\ResourceDecorator;
use WP_Statistics\Decorators\UserDecorator;
use WP_Statistics\Models\VisitorsModel;
class EventDecorator
{
protected $event;
protected $eventData;
public function __construct($event)
{
$this->event = $event;
$this->eventData = json_decode($this->event->event_data, true);
}
public function getDate($raw = false)
{
return $raw ? $this->event->date : DateTime::format($this->event->date, ['include_time' => true]);
}
public function getName()
{
return $this->event->event_name;
}
public function getData()
{
return $this->eventData;
}
public function getPage()
{
return new ResourceDecorator($this->event->page_id);
}
public function getUser()
{
return new UserDecorator($this->event->user_id);
}
public function getVisitor()
{
$visitorsModel = new VisitorsModel();
return $visitorsModel->getVisitorData(['visitor_id' => $this->event->visitor_id]);
}
}