Package DE_EPAGES::Object::API::Object::Site
object interface for Site.
Base |
DE_EPAGES::Object::API::Object::Object |
Functions
- addLocale
- backofficeLocales
- className
- clearDeletedObjects
- clearPageCache
- clearUpdatedObjects
- currentDate
- dbPackage
- deleteFiles
- existsLocale
- existsSiteLocale
- filePath
- findCreatedObjects
- findUpdatedObjects
- getCreatedObjects
- getDeletedObjects
- getSite
- getUpdatedObjects
- insertIntoPoolDB
- invalidatePageCache
- isTemporaryClosed
- loadObject
- loadObjectByGuid
- loadObjects
- loadObjectsByGuid
- removeLocale
- siteLocale
- units
- useMobileView
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 |
|
Return |
|
backofficeLocales
Returns all locales that can be used in the back-office of the site.
Syntax |
$aLocales = $Site->backofficeLocales; |
Return |
|
className
Returns the class name, used for DAL access.
Syntax |
$ClassName = $Site->className; |
Return |
|
clearDeletedObjects
Deletes information about objects in the site of a given type that have been deleted before a given date, for example which products have been deleted more than 2 weeks ago.
Syntax |
$Site->clearDeletedObjects( $ClassName, $DeletedBefore ); |
Input |
|
clearPageCache
Clears the page cache of the complete site.
Syntax |
$Shop->clearPageCache(); |
clearUpdatedObjects
Deletes information about updated objects in the site of a given profile.
Syntax |
$Site->clearUpdatedObjects( $Profile, $UpdatedBefore ); |
Input |
|
currentDate
Returns the current date in the time zone of the site with time set to midnight (0:00:00).
Syntax |
$Date = DE_EPAGES::Object::API::Object::Site->currentDate(); |
Return |
|
dbPackage
Returns the database package, used for DAL access.
Syntax |
$DbPackage = $Site->dbPackage; |
Return |
|
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 |
|
Return |
|
existsSiteLocale
Returns true if the site supports the given locale.
Syntax |
$Exists = $Site->existsSiteLocale($LocaleID); |
Example |
if( $Site->existsSiteLocale('en_GB') ) { ... } |
Input |
|
Return |
|
filePath
Call DE_EPAGES::Core::API::File::ConvertPathChars with site 'Alias' and parent of site.
Syntax |
$Path = $Site->filePath; |
Return |
|
findCreatedObjects
Returns information about objects of given class/subclass in the site that have been created after a given date
Syntax |
$Iterator = $Site->findCreatedObjects( $Class, $CreatedAfter ); §exmple $Iterator = $Shop->findCreatedObjects( $Shop->get('ProductClass'), $Created ); |
Input |
|
Return |
|
findUpdatedObjects
Returns information about objects in the site that have been updated regarding a LastUpdateProfile after a given date
Syntax |
$Iterator = $Site->findUpdatedObjects( $Profile, $UpdatedAfter ); |
Input |
|
Return |
|
getCreatedObjects
Returns objects of given class/subclass in the site that have been created after a given date
Syntax |
$Iterator = $Site->getCreatedObjects( $Class, $CreatedAfter ); §exmple $Iterator = $Shop->getCreatedObjects( $Shop->get('ProductClass'), $Created ); |
Input |
|
Return |
|
getDeletedObjects
Returns information about objects in the site of a given type that have been deleted after a given date, for example which products have been deleted in a shop since last week.
Syntax |
$ahDeletedObjects= $Site->getDeletedObjects( $ClassName, $DeletedAfter ); |
Input |
|
Return |
|
getSite
Returns the site of an object. In this case returns the object itself.
Syntax |
$Site = $Object->getSite; |
Return |
|
getUpdatedObjects
Returns objects in the site that have been updated regarding a LastUpdateProfile after a given date
Syntax |
$Iterator = $Site->getUpdatedObjects( $Profile, $UpdatedAfter ); |
Input |
|
Return |
|
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 |
|
loadObject
Loads an object by object id. Verifies that the object belongs to the given class and site.
Syntax |
$Object = $Site->loadObject( $ObjectID, $Class ); $Object = $Site->loadObject( $ObjectID, $ClassName ); $Object = $Site->loadObject( $ObjectID, $Class, $hFlags ); $Object = $Site->loadObject( $ObjectID, $ClassName, $hFlags ); |
Example |
my $ProductID = $Servlet->form->value('ProductID'); my $Object = $Shop->loadObject( $ProductID, 'Product' ); my $Unit = $Shop->loadObject( $UnitID, 'UnitOfMeasurement', { AllowSystemSite => 1 } ); |
Input |
|
Return |
|
loadObjectByGuid
Loads an object by GUID. Verifies that the object belongs to the given class and site.
Syntax |
$Object = $Site->loadObjectByGuid( $GUID, $Class ); $Object = $Site->loadObjectByGuid( $GUID, $ClassName ); $Object = $Site->loadObjectByGuid( $GUID, $Class, $hFlags ); $Object = $Site->loadObjectByGuid( $GUID, $ClassName, $hFlags ); |
Example |
my $ProductGUID = $Servlet->form->value('ProductGUID'); my $Object = $Shop->loadObject( $ProductGUID, 'Product' ); my $Unit = $Shop->loadObject( $UnitGUID, 'UnitOfMeasurement', { AllowSystemSite => 1 } ); |
Input |
|
Return |
|
loadObjects
Loads a list of objects by object ids. Verifies that the objects belongs to the given class and site.
Syntax |
$aObjects = $Site->loadObjects( $aObjectIDs, $Class ); $aObjects = $Site->loadObjects( $aObjectIDs, $ClassName ); $aObjects = $Site->loadObjects( $aObjectIDs, $Class, $hFlags ); $aObjects = $Site->loadObjects( $aObjectIDs, $ClassName, $hFlags ); |
Example |
my @ProductIDs = $Servlet->form->value('ProductID'); my $aProducts = $Shop->loadObjects( \@ProductIDs, 'Product' ); |
Input |
|
Return |
|
loadObjectsByGuid
Loads a list of objects by GUID. Verifies that the objects belongs to the given class and site.
Syntax |
$aObjects = $Site->loadObjectsByGuid( $aGUIDs, $Class ); $aObjects = $Site->loadObjectsByGuid( $aGUIDs, $ClassName ); $aObjects = $Site->loadObjectsByGuid( $aGUIDs, $Class, $hFlags ); $aObjects = $Site->loadObjectsByGuid( $aGUIDs, $ClassName, $hFlags ); |
Example |
my @ProductGUID = $Servlet->form->value('ProductGUID'); my $aProducts = $Shop->loadObjectsByGuid( \@ProductGUIDs, 'Product' ); |
Input |
|
Return |
|
removeLocale
Removes a storefront locale from the site.
Syntax |
$Site->removeLocale($LocaleID); |
Example |
$Site->removeLocale('de_DE'); |
Input |
|
siteLocale
Returns locale object with given locale identifier.
Syntax |
$Locale = $Site->siteLocale($LocaleID); |
Example |
$Site->siteLocale('en_GB')->roundMoney($amount, $CurrencyID); |
Input |
|
Return |
|
units
Returns a list of all units of measurements that are available in the site.
Syntax |
$aUnits = $Site->units; |
Return |
|
useMobileView
if the site allows mobile view
Syntax |
$UseMobileView = DE_EPAGES::Object::API::Object::Site->useMobileView(); |
Return |
|