ePages 6.10 - DE_EPAGES/Object/API/Object/Site.pm

Package DE_EPAGES::Object::API::Object::Site

object interface for Site.

Base
DE_EPAGES::Object::API::Object::Object

Functions

addLocale
backofficeLocales
className
clearPageCache
dbPackage
deleteFiles
existsLocale
existsSiteLocale
filePath
insertIntoPoolDB
invalidatePageCache
isTemporaryClosed
removeLocale
siteLocale
units

addLocale

Adds a storefront locale to the site. Use $Site->get('SiteLocales') to get a list of all storefront locales.

Syntax
$SiteLocale = $Site->addLocale($LocaleID);
Example
$SiteLocale = $Site->addLocale('de_DE');
Input
$LocaleID (string)
Locale identifier
Return
$SiteLocale (object)
SiteLocale object

backofficeLocales

Returns all locales that can be used in the back-office of the site.

Syntax
$aLocales = $Site->backofficeLocales;
Return
$aLocales (ref.array.object)
list of SiteLocale objects

className

Returns the class name, used for DAL access.

Syntax
$ClassName = $Site->className;
Return
$ClassName (String)
class name

clearPageCache

Clears the page cache of the complete site.

Syntax
$Shop->clearPageCache();

dbPackage

Returns the database package, used for DAL access.

Syntax
$DbPackage = $Site->dbPackage;
Return
$DbPackage (String)
database package name

deleteFiles

Deletes the directories PublicPath, PrivatePath.

Syntax
$Object->deleteFiles;

existsLocale

Returns true if the locale is $LocaleID is a storefront locale of the site.

Syntax
$exists = $Site->existsLocale($LocaleID);
Example
$exists = $Site->existsLocale('de_DE');
Input
$LocaleID (string)
Locale identifier
Return
$exists (boolean)
true if locale exists in site

existsSiteLocale

Returns true if the site supports the given locale.

Syntax
$Exists = $Site->existsSiteLocale($LocaleID);
Example
if( $Site->existsSiteLocale('en_GB') ) { ... }
Input
$LocaleID (string)
locale id, e.g. 'en_GB'
Return
$Exists (boolean)
true if the locale is supported by the site

filePath

Call DE_EPAGES::Core::API::File::ConvertPathChars with site 'Alias' and parent of site.

Syntax
$Path = $Site->filePath;
Return
$Path (string)
relative file path

insertIntoPoolDB

Insert this object in to the pooldb.

Syntax
$Site->insertIntoPoolDB();

invalidatePageCache

invalidates the page cache, use clearPageCache to clear it.

Syntax
$Shop->invalidatePageCache();

isTemporaryClosed

This method should be overwritten. Otherwise it returns always 0. That means the site is open. Returns true if the site is closed temporary. In this case all pages should be delivered with the HTTP status 503 (Service Temporarily Unavailable) to prevent search engines from caching the "shop closed" message.

Syntax
$IsClosed = $Site->isTemporaryClosed;
Return
$IsClosed (boolean)
true if site is closed

removeLocale

Removes a storefront locale from the site.

Syntax
$Site->removeLocale($LocaleID);
Example
$Site->removeLocale('de_DE');
Input
$LocaleID (string)
Locale identifier

siteLocale

Returns locale object with given locale identifier.

Syntax
$Locale = $Site->siteLocale($LocaleID);
Example
$Site->siteLocale('en_GB')->roundMoney($amount, $CurrencyID);
Input
$LocaleID (string)
locale id, e.g. 'en_GB'
Return
$Locale (object)
supported locale of site

units

Returns a list of all units of measurements that are available in the site.

Syntax
$aUnits = $Site->units;
Return
$aUnits (ref.array.object)
units of measurements (class UnitOfMeasurement)