ePages 7.17.0 - DE_EPAGES/Content/API/Object/Category.pm

Package DE_EPAGES::Content::API::Object::Category

object interface for Category.

Base
DE_EPAGES::Content::API::Object::ContentObject

Functions

clone
countCategoryNesting
createURI
featureName
getShopUrl
recursivSubCategories

clone

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

Syntax
$Clone = $Category->clone( $hInfo );
$Clone = $Category->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 category object

countCategoryNesting

Counts the number of parent objects that are of type category.

Syntax
$CategoryLevel = DE_EPAGES::Content::API::Object::Category->countCategoryNesting;
Example
$CategoryLevel= $Parent->countCategoryNesting;
Return
$CategoryLevel (int)
nesting depth of the calling category

createURI

Returns a suggestion for a short url.

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

featureName

Returns the feature name.

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

getShopUrl

Construct the shop url of a given object dependend of the following parameters:

Syntax
$ShopUrl = $Object->getShopUrl($hParams, $hOptions, $Servlet);
Input
$hParams (ref.hash)
url get parameters; values may be strings or arrays of strings
$hOptions (ref.hash)
with following keys:
  • Type - one of 'sf', 'admin', 'mobile', 'sf/mobile',
    if type is 'sf/mobile' a .mobile will be generated if the servlet is defined and the client
    is a mobile device, otherwise a .sf url is generated; defaults to 'sf' - string
  • UseSSL - use https as protocol if SSL enabled for shop / database (optional, defaults to 0) - boolean
  • UseObjectPath - use object path rather than objectid (optional, defaults to 0) - boolean
  • AddToken - add security token or not (optional, defaults to 0) - boolean
  • Token - the security token (required AddToken is true) - String
  • Cookies - add cookies to url or not (optional, defaults to 0) - boolean
  • AddCookies - cookie values (required if AddCookies is true) - hash.ref
  • NoUTF8 - do not use utf-8 for encoding get parameters (optional, defaults to 0) - boolean
  • IsMobileServlet - is the client a mobile device or not - boolean
$Shop (object)
the current shop
Return
$url (string)
the url

recursivSubCategories

Returns all sub categories, recurive depth can limit bei $MaxLevel.

Syntax
$aSubCategories = $category->recursivSubCategories;
Input
$MaxLevel (integer)
maximum depth of category tree
Return
$aSubCategories (reference to array of object)
list of sub categories