Properties

$datetime

$datetime : \DateTime

Datetime of the item

Type

\DateTime

$timezone

$timezone : \DateTimeZone

Timezone of the datetime of this item

Type

\DateTimeZone

$sitemap_slug

$sitemap_slug : string

Slug of the logged sitemap

Type

string

Methods

get_item_data()

get_item_data() : array

Get a simple array representation of the item

This is intended to be stored in a persistence layer

Returns

array

set_datetime()

set_datetime(\DateTime  $datetime) 

Parameters

\DateTime $datetime

set_datetimezone()

set_datetimezone(\DateTimeZone  $timezone) 

Parameters

\DateTimeZone $timezone

get_datetime()

get_datetime() : \DateTime

Get datetime of this item, with proper timezone set if applicable

Returns

\DateTime

get_timestamp()

get_timestamp() : integer

Get datetime of this item, in Unix Timestamp and UTC

Returns

integer

get_local_timestamp()

get_local_timestamp() : integer

Same as get_timestamp() but the result is in local timezone

Returns

integer

get_storage_datetime()

get_storage_datetime() : string

Get datetime formatted in a way that's suitable for storage

This should use $datetime with UTC timezone

Returns

string

get_formatted_datetime()

get_formatted_datetime(  $format = 'M d, Y h:i:s A') : string

Get datetime formatted in a way that is suitable for displaying

This should use $datetime with local timezone set

Parameters

$format

Returns

string

__construct()

__construct(string  $slug, string  $datetime = null) 

Parameters

string $slug
string $datetime

default to now, expect to be in UTC timezone

is_obsolete()

is_obsolete() : boolean

Check whether this log item is obsolete

An item is obsolete when it's at least 1-month old

Returns

boolean

get_sitemap_slug()

get_sitemap_slug()