ePages 7.48.0 - DE_EPAGES/Content/API/Object/ContentObject.pm

Package DE_EPAGES::Content::API::Object::ContentObject

object interface for ContentObject.

Base
DE_EPAGES::Shop::API::Object::ShopObject

Functions

addImageInformations
canInvalidatePageCache
className
clone
createURI
dbPackage
defaultObject
exportableChildren
featureName
getFieldContent
getImageInfo
isAllowedChild
requiredChildClass
template
useFilePathPart

addImageInformations

rewrite the JSON attribute ImageInformations for content objects. Should be called by "set" and "clone" functions on the changed content object like products

Syntax
$Object->addImageInformations($aAllImageAttributes, $hNewValues);
Input
$aAllImageAttributes (ref.array)
all image attribute names for this object
$hNewValues (ref.hash)
changed values

canInvalidatePageCache

Overwrites method DE_EPAGES::Object::API::Object::Object->canInvalidatePageCache to invalidate page cache.

Syntax
$CanInvalidate = $Object->canInvalidatePageCache;
Return
$CanInvalidate (boolean)
true if the object affects the page cache

className

Returns the class name, used for DAL access.

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

clone

Inserts a new object into the database as copy from old object.

Syntax
$Clone = $Object->clone( $hInfo );
$Clone = $Object->clone( $hInfo, $Recursive );
Input
$hInfo (hash ref)
hash with attribute values that are different in the clone object.
Note that the clone cannot have the same Parent and the same Alias.
$Recursive (boolean)
clone child object too (optional, default is false)
Return
$Clone (object)
the new object

createURI

Returns a suggestion for a short url.

Syntax
$URI = $Object->createURI($Name, $Parent, $LanguageID);
Input
$Name (string)
suggested URI
$Parent (object)
parent object
$LanguageID (integer)
language id
Return
$URI (string)
URI path

dbPackage

Returns the database package, used for DAL access.

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

defaultObject

Returns the default object (has to be overwritten for products with variation).

Syntax
$ContentObject = $Object->defaultObject();
Return
$ContentObject (object)
content object

exportableChildren

Returns all children of the object which should be exported.

Syntax
$aChildren = $Object->exportableChildren
Example
$Description = $Object->exportableChildren;
Return
$aChildren (array ref)
children of the object

featureName

Returns the feature name.

Syntax
$FeatureName = $Forum->featureName;
Return
$FeatureName (String)
feature name (undef means no feature count)

getFieldContent

Returns the value of a text field in product. If a subproduct doesn't define any new value, the value of the master product will be used. LanguageID is optional. It is used to get the translation of the value. This function exists, because ContentObject doesn't have getWithParent, but a unified interface was needed to get a text from a UI Object. See EPC-342

Syntax
$FieldValue = $Product->getFieldContent($FieldName, $LanguageID);
Example
$FieldValue = $Product->getFieldContent('Text', 'de');
$FieldValue = $Product->getFieldContent('Description');
Input
$FieldName (string)
name of the field
$LanguageID (string)
language code of a language (optional)
Return
$FieldValue (string)
fields text

getImageInfo

get width, height and size for a filename or filenames.

Syntax
$hImageInfo = $Object->getImageInfo;
Input
$ObjectFilePath (string)
public file path for this object
$FileNames (string)
filename or filenames separated by ;
Return
$hInfo (ref.hash)
hash with file informations

isAllowedChild

Returns if an Object could be the parent of a PossibleChild.

Syntax
$isAllowed = $Object->isAllowedChild($PossibleChild);
Input
$PossibleChild (DE_EPAGES::Content::API::Object::ContentObject)
proposed child object
Return
$isAllowed (boolean)
is a allowed child type

requiredChildClass

Returns the name of the class a new child is required to be an instance of or undef if no class is allowed (no children).

Syntax
$RequiredChildClass = $ContentObject->requiredChildClass;
Return
$RequiredChildClass (String)
name of a class, i.e. "Object"

template

This function is used to overwrite the given template for the purpose that each content object can defined there own template (visualisation).

Syntax
$Name = $Object->template($Name, $ObjectPageType);
Input
$Name (string)
include name
$ObjectPageType (DE_EPAGES::Presentation::API::Object::ObjectPageType)
object related pagetype
Return
$Name (string)
include name

useFilePathPart

Use FilePathPart for content objects.

Syntax
$useFilePathPart = $Object->useFilePathPart;
Return
$useFilePathPart (boolean)
false if not use filepathpart