Open Monograph Press  3.3.0
PublicationDate Class Reference
Inheritance diagram for PublicationDate:
DataObject

Public Member Functions

 __construct ()
 
 getDate ()
 
 getDateFormat ()
 
 getNameForONIXCode ()
 
 getPublicationFormatId ()
 
 getReadableDates ()
 
 getRole ()
 
 getUnixTime ()
 
 isFreeText ()
 
 isHijriCalendar ()
 
 setDate ($date)
 
 setDateFormat ($format)
 
 setPublicationFormatId ($publicationFormatId)
 
 setRole ($role)
 
- Public Member Functions inherited from DataObject
 addSupportedMetadataAdapter ($metadataAdapter)
 
 extractMetadata ($metadataSchema)
 
 getAdditionalMetadataFieldNames ()
 
getAllData ()
 
 getDAO ()
 
getData ($key, $locale=null)
 
 getHasLoadableAdapters ()
 
 getId ()
 
 getLocaleMetadataFieldNames ()
 
 getLocalizedData ($key, $preferredLocale=null)
 
 getMetadataFieldNames ($translated=true)
 
 getSetMetadataFieldNames ($translated=true)
 
 getSupportedExtractionAdapters ()
 
 getSupportedInjectionAdapters ()
 
 getSupportedMetadataSchemas ()
 
 hasData ($key, $locale=null)
 
 injectMetadata ($metadataDescription)
 
 removeSupportedMetadataAdapter ($metadataSchemaName)
 
 setAllData (&$data)
 
 setData ($key, $value, $locale=null)
 
 setHasLoadableAdapters ($hasLoadableAdapters)
 
 setId ($id)
 
 unsetData ($key, $locale=null)
 
 upcastTo ($targetObject)
 

Data Fields

 $dateFormats
 
- Data Fields inherited from DataObject
 $_data = array()
 
 $_extractionAdaptersLoaded = false
 
 $_hasLoadableAdapters = false
 
 $_injectionAdaptersLoaded = false
 
 $_metadataExtractionAdapters = array()
 
 $_metadataInjectionAdapters = array()
 

Detailed Description

Basic class describing a publication date for a format (used on the ONIX templates for publication formats)

See also
PublicationDateDAO

Definition at line 17 of file PublicationDate.inc.php.

Constructor & Destructor Documentation

◆ __construct()

PublicationDate::__construct ( )

Constructor

Reimplemented from DataObject.

Definition at line 28 of file PublicationDate.inc.php.

References DAORegistry\getDAO().

Member Function Documentation

◆ getDate()

PublicationDate::getDate ( )

Get the date for the publication date

Returns
string

Definition at line 106 of file PublicationDate.inc.php.

References DataObject\getData().

Referenced by getReadableDates(), and getUnixTime().

◆ getDateFormat()

PublicationDate::getDateFormat ( )

Get the date format for the publication date

Returns
string

Definition at line 80 of file PublicationDate.inc.php.

References DataObject\getData().

Referenced by getReadableDates(), getUnixTime(), isFreeText(), and isHijriCalendar().

◆ getNameForONIXCode()

PublicationDate::getNameForONIXCode ( )

Get the human readable name for this ONIX code

Returns
string

Definition at line 88 of file PublicationDate.inc.php.

References DAORegistry\getDAO(), and getRole().

◆ getPublicationFormatId()

PublicationDate::getPublicationFormatId ( )

get publication format id

Returns
int

Definition at line 40 of file PublicationDate.inc.php.

References DataObject\getData().

◆ getReadableDates()

PublicationDate::getReadableDates ( )

returns a readable version of the entered date, based on the format specified from List55. Necessary, so it can be parsed correctly in the template.

Returns
string

Definition at line 142 of file PublicationDate.inc.php.

References $dateFormats, PKPApplication\get(), getDate(), getDateFormat(), isFreeText(), and isHijriCalendar().

◆ getRole()

PublicationDate::getRole ( )

Get the ONIX code for the publication date

Returns
string

Definition at line 64 of file PublicationDate.inc.php.

References DataObject\getData().

Referenced by getNameForONIXCode().

◆ getUnixTime()

PublicationDate::getUnixTime ( )

Return a best guess of the UNIX time corresponding to this date

Returns
int? Number of seconds since the UNIX epoch, or null if it could not be determined FIXME: Hirji support

Definition at line 221 of file PublicationDate.inc.php.

References getDate(), and getDateFormat().

◆ isFreeText()

PublicationDate::isFreeText ( )

determines whether or not the date should be parsed out with a date format.

Returns
boolean

Definition at line 127 of file PublicationDate.inc.php.

References getDateFormat().

Referenced by getReadableDates().

◆ isHijriCalendar()

PublicationDate::isHijriCalendar ( )

Determines if this date is from the Hijri calendar.

Returns
boolean

Definition at line 114 of file PublicationDate.inc.php.

References getDateFormat().

Referenced by getReadableDates().

◆ setDate()

PublicationDate::setDate (   $date)

Set the date for this publication date

Parameters
$datestring

Definition at line 98 of file PublicationDate.inc.php.

References DataObject\setData().

◆ setDateFormat()

PublicationDate::setDateFormat (   $format)

Set the date format for this publication date (ONIX Codelist List55)

Parameters
$formatstring

Definition at line 72 of file PublicationDate.inc.php.

References DataObject\setData().

◆ setPublicationFormatId()

PublicationDate::setPublicationFormatId (   $publicationFormatId)

set publication format id

Parameters
$publicationFormatIdint

Definition at line 48 of file PublicationDate.inc.php.

References DataObject\setData().

◆ setRole()

PublicationDate::setRole (   $role)

Set the ONIX code for this publication date

Parameters
$rolestring

Definition at line 56 of file PublicationDate.inc.php.

References DataObject\setData().

Field Documentation

◆ $dateFormats

$dateFormats PublicationDate::$dateFormats

the formats for this publication date

Definition at line 23 of file PublicationDate.inc.php.

Referenced by getReadableDates().


The documentation for this class was generated from the following file: