Trace
Class Trace
Table of Contents
Constants
Methods
- __construct() : mixed
- Trace constructor.
- addChannel() : $this
- Add channel.
- addPage() : $this
- Add page.
- addUtm() : $this
- Add utm.
- appendChannel() : void
- Append channel to trace.
- appendEntity() : void
- Append channel to trace.
- create() : static
- Create trace from string.
- detectEntities() : $this
- Detect entities.
- getAnalyticsClient() : mixed
- getChannelCollection() : Collection|null
- getGid() : string|null
- Get guest id.
- getId() : int|null
- Get ID.
- getPages() : array<string|int, mixed>
- Get pages.
- getSourceId() : mixed
- getUrl() : string
- Get url.
- getUtm() : array<string|int, mixed>
- Get utm.
- loadByArray() : $this
- Load by array.
- save() : int|null
- Save.
- setGid() : $this
- Set guest id.
- setMobile() : $this
- Set mobile.
- setReferrer() : $this
- Set referrer.
- setSource() : $this
- Set source.
- setUrl() : $this
- Set url.
- useDetectingOfDateCreate() : $this
- Use detecting of date create.
- useTraceDetecting() : $this
- Use trace detecting.
Constants
DETECT_TIME_MINUTES
public
mixed
DETECT_TIME_MINUTES
= 10
FIND_ENTITIES_TIME_DAYS
public
mixed
FIND_ENTITIES_TIME_DAYS
= 7
Methods
__construct()
Trace constructor.
public
__construct([array<string|int, mixed> $data = null ]) : mixed
Parameters
- $data : array<string|int, mixed> = null
-
Data.
addChannel()
Add channel.
public
addChannel(Base $channel) : $this
Parameters
- $channel : Base
-
Channel instance.
Return values
$thisaddPage()
Add page.
public
addPage(string $url, int $timestamp[, string|null $title = null ]) : $this
Parameters
- $url : string
-
Url.
- $timestamp : int
-
Timestamp.
- $title : string|null = null
-
Title.
Return values
$thisaddUtm()
Add utm.
public
addUtm(string $name, string $value) : $this
Parameters
- $name : string
-
Name.
- $value : string
-
Value.
Return values
$thisappendChannel()
Append channel to trace.
public
static appendChannel(int $traceId, Base $channel) : void
Parameters
- $traceId : int
-
Trace ID.
- $channel : Base
-
Channel.
appendEntity()
Append channel to trace.
public
static appendEntity(int $traceId, int $entityTypeId, int $entityId) : void
Parameters
- $traceId : int
-
Trace ID.
- $entityTypeId : int
-
Entity type ID.
- $entityId : int
-
Entity ID.
create()
Create trace from string.
public
static create([string|null $string = null ]) : static
Parameters
- $string : string|null = null
-
Trace string.
Return values
staticdetectEntities()
Detect entities.
public
detectEntities() : $this
Return values
$thisgetAnalyticsClient()
public
getAnalyticsClient() : mixed
getChannelCollection()
public
getChannelCollection() : Collection|null
Return values
Collection|nullgetGid()
Get guest id.
public
getGid() : string|null
Return values
string|nullgetId()
Get ID.
public
getId() : int|null
Return values
int|nullgetPages()
Get pages.
public
getPages() : array<string|int, mixed>
Return values
array<string|int, mixed>getSourceId()
public
getSourceId() : mixed
getUrl()
Get url.
public
getUrl() : string
Return values
stringgetUtm()
Get utm.
public
getUtm() : array<string|int, mixed>
Return values
array<string|int, mixed>loadByArray()
Load by array.
public
loadByArray(array<string|int, mixed> $data) : $this
Parameters
- $data : array<string|int, mixed>
-
Data.
Return values
$thissave()
Save.
public
save() : int|null
Return values
int|nullsetGid()
Set guest id.
public
setGid(string $gid) : $this
Parameters
- $gid : string
-
Guest ID.
Return values
$thissetMobile()
Set mobile.
public
setMobile(bool $isMobile) : $this
Parameters
- $isMobile : bool
-
Is mobile.
Return values
$thissetReferrer()
Set referrer.
public
setReferrer(string $ref) : $this
Parameters
- $ref : string
-
Referrer page.
Return values
$thissetSource()
Set source.
public
setSource(int|string $source) : $this
Parameters
- $source : int|string
-
Source code or ID.
Return values
$thissetUrl()
Set url.
public
setUrl(string $url) : $this
Parameters
- $url : string
-
Url.
Return values
$thisuseDetectingOfDateCreate()
Use detecting of date create.
public
useDetectingOfDateCreate([bool $mode = true ]) : $this
Parameters
- $mode : bool = true
-
Mode.
Return values
$thisuseTraceDetecting()
Use trace detecting.
public
useTraceDetecting([bool $mode = true ]) : $this
Parameters
- $mode : bool = true
-
Mode.