\ BWP_Sitemaps_Logger_LogItem

Summary

Methods
Properties
Constants
get_item_data()
set_datetime()
set_datetimezone()
get_datetime()
get_timestamp()
get_local_timestamp()
get_storage_datetime()
get_formatted_datetime()
No public properties found
No constants found
No protected methods found
$datetime
$timezone
N/A

Properties

$datetime

$datetime : \DateTime

Datetime of the item

Type

\DateTime

$timezone

$timezone : \DateTimeZone

Timezone of the datetime of this item

Type

\DateTimeZone

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