|
Server : LiteSpeed System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64 User : gazetufm ( 1431) PHP Version : 8.1.35 Disable Function : NONE Directory : /home2/gazetufm/dumoshi.com/wp-content/plugins/wp-statistics/src/Decorators/ | |
|
Path: //home2/gazetufm/dumoshi.com/wp-content/plugins/wp-statistics/src/Decorators/EventDecorator.php
Size: 1.13 KB
Permissions: 0644
<?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]);
}
}