ePages 6.13.1 - DE_EPAGES/MultiStore/API/Object.pm

Package DE_EPAGES::MultiStore::API::Object

Affiliate Object API

Base
Exporter
@EXPORT_OK
NewAffiliateObject
MapAttributeNames
GetRemoteAttributes
PathStringFromSite
PathStringFromSubShop
VisibleInSubShop
SerializeObject
DeserializeObject
GetWithMaster

Functions

DeserializeObject
GetRemoteAttributes
GetWithMaster
MapAttributeNames
NewAffiliateObject
PathStringFromSite
PathStringFromSubShop
SerializeObject
VisibleInSubShop

DeserializeObject

Checks if $Element is deserializable by calling ->can('doDeserialize'). If yes, it returns the result of that. If not, $Element is returned unchanged

Syntax
DeserializeObject( $Element, $Site );
Input
$Element (any)
any input
$Site (object)
Site object as reference point to deserialize from
Return
$DeserializedObject (any)
deserialized object

GetRemoteAttributes

Returns attributes coming from the remote object mapped into local objects.

Syntax
GetRemoteAttributes( $LocalObject, $aNames, $LanguageID );
Input
$LocalObject (object)
local object
$aNames (ref.array.string)
attribute names
$LanguageID (integer)
language id
Return
$hReturn (ref.hash)
return values

GetWithMaster

Used in TLE context to fetch affiliate object information with information from the master object. Some attributes are only used locally (Parent ObjectID etc) and some are overwritable, so that a combination of affiliate and master object values is return.

Syntax
GetWithMaster( $Object, $aNames, $LanguageID, $aLOCAL_ATTRIBUTES, $aOVERWRITABLE_ATTRIUBTES, $cGetMasterObject );
Input
$Object (object)
affiliate objec
$aNames (ref.array.string or string)
attribute names
$LanguageID (integer)
language id (optional)
$aLOCAL_ATTRIBUTES (ref.array.string)
local attribute names
$aOVERWRITABLE_ATTRIUBTES (ref.array.string)
overwritable attribute names
$cGetMasterObject (ref.code)
returns the master object
Return
$Return (any)
return of get function

MapAttributeNames

Maps internal (SuperProductID) to external (SuperProduct) names

Syntax
MapAttributeNames( $Object, $aNames );
Input
$Object (object)
input object
$aNames (ref.array.string)
internal cache attribute names
Return
$aMappedNames (ref.array.string)
mapped attribute names

NewAffiliateObject

inserts an affiliate object.

Syntax
NewAffiliateObject( $Parent, $Class, $hAttributes );
Input
$Parent (object)
parent object
$Class (object)
affiliate class
$hAttributes (ref.hash)
initial attributes
Return
$AffiliateObject (object)
affiliate object

PathStringFromSite

Returns the relative path based from the object's site

Syntax
PathStringFromSite( $Object );
Input
$Object (object)
object
Return
$PathString (string)
path string

PathStringFromSubShop

Returns the relative path based from the object's site

Syntax
PathStringFromSubShop( $Object );
Input
$Object (object)
object
Return
$PathString (string)
path string

SerializeObject

Serializes an Object into a placeholder containing a the object path If no object is passed, $Element is returned unchanged.

Syntax
SerializeObject( $Element );
Input
$Element (any)
object or any other input
Return
$SerializedElement (any)
serialized element

VisibleInSubShop

Returns true if affiliate object is visible in subshop

Syntax
VisibleInSubShop( $LocalObject, $SubShop );
Input
$LocalObject (object)
local content object
$SubShop (object)
subshop object
Return
$IsVisible (boolean)
true if object is visible