Open Journal Systems  3.3.0
Context Class Reference
Inheritance diagram for Context:
DataObject Journal

Public Member Functions

 getAcronym ($locale)
 
 getAssocType ()
 
 getContactEmail ()
 
 getContactName ()
 
 getDateTimeFormats ($format)
 
 getDefaultMetricType ()
 
 getDescription ($locale=null)
 
 getEnabled ()
 
 getLocalizedAcronym ()
 
 getLocalizedDateFormatLong ($locale=null)
 
 getLocalizedDateFormatShort ($locale=null)
 
 getLocalizedDateTimeFormatLong ($locale=null)
 
 getLocalizedDateTimeFormatShort ($locale=null)
 
 getLocalizedDescription ()
 
 getLocalizedFavicon ()
 
 getLocalizedName ($preferredLocale=null)
 
 getLocalizedSetting ($name, $locale=null)
 
 getLocalizedTimeFormat ($locale=null)
 
 getMetrics ($metricType=null, $columns=array(), $filter=array(), $orderBy=array(), $range=null)
 
 getMetricTypes ($withDisplayNames=false)
 
 getName ($locale=null)
 
 getPath ()
 
 getPrimaryLocale ()
 
 getSequence ()
 
 getSetting ($name, $locale=null)
 
 getSupportedFormLocaleNames ()
 
 getSupportedFormLocales ()
 
 getSupportedLocaleNames ()
 
 getSupportedLocales ()
 
 getSupportedSubmissionLocaleNames ()
 
 getSupportedSubmissionLocales ()
 
 getViews ()
 
 setContactEmail ($contactEmail)
 
 setContactName ($contactName)
 
 setDescription ($description, $locale=null)
 
 setEnabled ($enabled)
 
 setName ($name, $locale=null)
 
 setPath ($path)
 
 setPrimaryLocale ($primaryLocale)
 
 setSequence ($sequence)
 
 updateSetting ($name, $value, $type=null, $isLocalized=false)
 
- Public Member Functions inherited from DataObject
 __construct ()
 
 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)
 

Additional Inherited Members

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

Detailed Description

Basic class describing a context.

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

Member Function Documentation

◆ getAcronym()

Context::getAcronym (   $locale)

Get the acronym of the context.

Parameters
$localestring
Returns
string

Definition at line 183 of file Context.inc.php.

References DataObject\getData().

◆ getAssocType()

Context::getAssocType ( )
abstract

Get the association type for this context.

Returns
int

Reimplemented in Journal.

◆ getContactEmail()

Context::getContactEmail ( )

Get the contact email for this context

Returns
string

Definition at line 69 of file Context.inc.php.

References DataObject\getData().

◆ getContactName()

Context::getContactName ( )

Get the contact name for this context

Returns
string

Definition at line 53 of file Context.inc.php.

References DataObject\getData().

◆ getDateTimeFormats()

Context::getDateTimeFormats (   $format)

Return date or/and time formats available for forms, fallback to the default if not set

Parameters
$formatstring datetime property, e.g., dateFormatShort
Returns
array

Definition at line 304 of file Context.inc.php.

References DataObject\getData(), getSupportedFormLocales(), and Config\getVar().

◆ getDefaultMetricType()

Context::getDefaultMetricType ( )

Returns the currently configured default metric type for this context. If no specific metric type has been set for this context then the site-wide default metric type will be returned.

Returns
null|string A metric type identifier or null if no default metric type could be identified.

Reimplemented in Journal.

Definition at line 475 of file Context.inc.php.

References $application, PKPApplication\get(), DataObject\getData(), and getMetricTypes().

◆ getDescription()

Context::getDescription (   $locale = null)

Get context description.

Parameters
$descriptionstring optional
Returns
string

Definition at line 86 of file Context.inc.php.

References DataObject\getData().

◆ getEnabled()

Context::getEnabled ( )

Get enabled flag of context

Returns
int

Definition at line 119 of file Context.inc.php.

References DataObject\getData().

◆ getLocalizedAcronym()

Context::getLocalizedAcronym ( )

Get localized acronym of context

Returns
string

Definition at line 174 of file Context.inc.php.

References DataObject\getLocalizedData().

◆ getLocalizedDateFormatLong()

Context::getLocalizedDateFormatLong (   $locale = null)

Return localized long date format, fallback to the default if not set

Returns
string, see DateTime::format

Definition at line 334 of file Context.inc.php.

References DataObject\getData(), AppLocale\getLocale(), and Config\getVar().

◆ getLocalizedDateFormatShort()

Context::getLocalizedDateFormatShort (   $locale = null)

Return localized short date format, fallback to the default if not set

Returns
string, see DateTime::format

Definition at line 318 of file Context.inc.php.

References DataObject\getData(), AppLocale\getLocale(), and Config\getVar().

◆ getLocalizedDateTimeFormatLong()

Context::getLocalizedDateTimeFormatLong (   $locale = null)

Return localized long date & time format, fallback to the default if not set

Returns
string, see see DateTime::format

Definition at line 382 of file Context.inc.php.

References DataObject\getData(), AppLocale\getLocale(), and Config\getVar().

◆ getLocalizedDateTimeFormatShort()

Context::getLocalizedDateTimeFormatShort (   $locale = null)

Return localized short date & time format, fallback to the default if not set

Returns
string, see see DateTime::format

Definition at line 366 of file Context.inc.php.

References DataObject\getData(), AppLocale\getLocale(), and Config\getVar().

◆ getLocalizedDescription()

Context::getLocalizedDescription ( )

Get the localized description of the context.

Returns
string

Definition at line 166 of file Context.inc.php.

References DataObject\getLocalizedData().

◆ getLocalizedFavicon()

Context::getLocalizedFavicon ( )

Get localized favicon

Returns
string

Definition at line 191 of file Context.inc.php.

References DataObject\getData(), AppLocale\getLocale(), and AppLocale\getPrimaryLocale().

◆ getLocalizedName()

Context::getLocalizedName (   $preferredLocale = null)

Get the localized name of the context

Parameters
$preferredLocalestring
Returns
string

Definition at line 30 of file Context.inc.php.

References DataObject\getLocalizedData().

◆ getLocalizedSetting()

Context::getLocalizedSetting (   $name,
  $locale = null 
)
Deprecated:
Most settings should be available from self::getData(). In other cases, use the context settings DAO directly.

Definition at line 412 of file Context.inc.php.

References DataObject\getLocalizedData().

◆ getLocalizedTimeFormat()

Context::getLocalizedTimeFormat (   $locale = null)

Return localized time format, fallback to the default if not set

Returns
string, see DateTime::format

Definition at line 350 of file Context.inc.php.

References DataObject\getData(), AppLocale\getLocale(), and Config\getVar().

◆ getMetrics()

Context::getMetrics (   $metricType = null,
  $columns = array(),
  $filter = array(),
  $orderBy = array(),
  $range = null 
)

Retrieve a statistics report pre-filtered on this context.

See also
https://pkp.sfu.ca/wiki/index.php/OJSdeStatisticsConcept#Input_and_Output_Formats_.28Aggregation.2C_Filters.2C_Metrics_Data.29 for a full specification of the input and output format of this method.
Parameters
$metricTypenull|integer|array metrics selection
$columnsinteger|array column (aggregation level) selection
$filtersarray report-level filter selection
$orderByarray order criteria
$rangenull|DBResultRange paging specification
Returns
null|array The selected data as a simple tabular result set or null if metrics are not supported by this context.

Reimplemented in Journal.

Definition at line 511 of file Context.inc.php.

References $application, PKPApplication\get(), and DataObject\getId().

◆ getMetricTypes()

Context::getMetricTypes (   $withDisplayNames = false)

Return all metric types supported by this context.

Returns
array An array of strings of supported metric type identifiers.

Reimplemented in Journal.

Definition at line 446 of file Context.inc.php.

References DataObject\getId(), and PluginRegistry\loadCategory().

Referenced by getDefaultMetricType().

◆ getName()

Context::getName (   $locale = null)

get the name of the context

Definition at line 45 of file Context.inc.php.

References DataObject\getData().

◆ getPath()

Context::getPath ( )

Get path to context (in URL).

Returns
string

Definition at line 103 of file Context.inc.php.

References DataObject\getData().

◆ getPrimaryLocale()

Context::getPrimaryLocale ( )

Return the primary locale of this context.

Returns
string

Definition at line 135 of file Context.inc.php.

References DataObject\getData().

Referenced by EditorialReportNotificationManager\initialize().

◆ getSequence()

Context::getSequence ( )

Get sequence of context in site-wide list.

Returns
float

Definition at line 150 of file Context.inc.php.

References DataObject\getData().

◆ getSetting()

Context::getSetting (   $name,
  $locale = null 
)
Deprecated:
Most settings should be available from self::getData(). In other cases, use the context settings DAO directly.

Definition at line 404 of file Context.inc.php.

References DataObject\getData().

◆ getSupportedFormLocaleNames()

Context::getSupportedFormLocaleNames ( )

Return associative array of all locales supported by forms on the site. These locales are used to provide a language toggle on the main site pages.

Returns
array

Definition at line 212 of file Context.inc.php.

References PKPLocale\getAllLocales(), DataObject\getData(), and getSupportedFormLocales().

◆ getSupportedFormLocales()

Context::getSupportedFormLocales ( )

Get the supported form locales.

Returns
array

Definition at line 203 of file Context.inc.php.

References DataObject\getData().

Referenced by getDateTimeFormats(), and getSupportedFormLocaleNames().

◆ getSupportedLocaleNames()

Context::getSupportedLocaleNames ( )

Return associative array of all locales supported by the site. These locales are used to provide a language toggle on the main site pages.

Returns
array

Definition at line 279 of file Context.inc.php.

References PKPLocale\getAllLocales(), DataObject\getData(), and getSupportedLocales().

◆ getSupportedLocales()

Context::getSupportedLocales ( )

Get the supported locales.

Returns
array

Definition at line 270 of file Context.inc.php.

References DataObject\getData().

Referenced by getSupportedLocaleNames().

◆ getSupportedSubmissionLocaleNames()

Context::getSupportedSubmissionLocaleNames ( )

Return associative array of all locales supported by submissions on the site. These locales are used to provide a language toggle on the main site pages.

Returns
array

Definition at line 246 of file Context.inc.php.

References PKPLocale\getAllLocales(), DataObject\getData(), and getSupportedSubmissionLocales().

◆ getSupportedSubmissionLocales()

Context::getSupportedSubmissionLocales ( )

Get the supported submission locales.

Returns
array

Definition at line 236 of file Context.inc.php.

References DataObject\getData().

Referenced by getSupportedSubmissionLocaleNames().

◆ getViews()

Context::getViews ( )

Get context main page views.

Returns
int

Definition at line 432 of file Context.inc.php.

References $application, PKPApplication\get(), Application\getContextAssocType(), and DataObject\getId().

◆ setContactEmail()

Context::setContactEmail (   $contactEmail)

Set the contact email for this context

Parameters
$contactEmailstring

Definition at line 77 of file Context.inc.php.

References DataObject\setData().

◆ setContactName()

Context::setContactName (   $contactName)

Set the contact name for this context

Parameters
$contactNamestring

Definition at line 61 of file Context.inc.php.

References DataObject\setData().

◆ setDescription()

Context::setDescription (   $description,
  $locale = null 
)

Set context description.

Parameters
$descriptionstring
$localestring optional

Definition at line 95 of file Context.inc.php.

References DataObject\setData().

◆ setEnabled()

Context::setEnabled (   $enabled)

Set enabled flag of context

Parameters
$enabledint

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

References DataObject\setData().

◆ setName()

Context::setName (   $name,
  $locale = null 
)

Set the name of the context

Parameters
$namestring

Definition at line 38 of file Context.inc.php.

References DataObject\setData().

◆ setPath()

Context::setPath (   $path)

Set path to context (in URL).

Parameters
$pathstring

Definition at line 111 of file Context.inc.php.

References DataObject\setData().

◆ setPrimaryLocale()

Context::setPrimaryLocale (   $primaryLocale)

Set the primary locale of this context.

Parameters
$localestring

Definition at line 143 of file Context.inc.php.

References DataObject\setData().

◆ setSequence()

Context::setSequence (   $sequence)

Set sequence of context in site table of contents.

Parameters
$sequencefloat

Definition at line 158 of file Context.inc.php.

References DataObject\setData().

◆ updateSetting()

Context::updateSetting (   $name,
  $value,
  $type = null,
  $isLocalized = false 
)

Update a context setting value.

Parameters
$namestring
$valuemixed
$typestring optional
$isLocalizedboolean optional

Definition at line 423 of file Context.inc.php.

References DataObject\getId().


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