ePages 6.17.17 - DE_EPAGES/Search/API/Object/SearchTerm.pm

Package DE_EPAGES::Search::API::Object::SearchTerm

object interface for SearchTerm.

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

Functions

className
dbPackage
delete
exportableAttributes
findXML
id
importXML
insert
primaryKey
set

className

Returns the class name, used for DAL access.

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

dbPackage

Returns the database package, used for DAL access.

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

delete

Deletes this object, therefore the hook 'OBJ_DeleteSearchTerm' is triggered.

Syntax
$SearchTerm->delete;
Hook
OBJ_DeleteSearchTerm
hook parameter keys :
  • Object - this object - object
  • SearchTermID - search term id - int

exportableAttributes

Returns all attribute values that have an existing (not-null) value. Unlike $Object->_attributes this function returns localized attribute values as hash reference (language id => value).

Syntax
$hValues = $Object->exportableAttributes
Example
$Description = $Object->exportableAttributes;
Return
$hValues (hash ref)
object attributes as key => value pairs

findXML

find searchterm form from an XML file.

Syntax
$ObjectID = DE_EPAGES::Search::API::Object::SearchTerm->findXML($Handler, $hElement, $Class, $hAttributes);
Input
$Handler (object)
xml import handler with support function addObject
$hElement (ref.hash)
XML element structure, see XML::SAX
$Class (object)
class object; the new object will be an instance of this class
$hAttributes (ref.hash)
attributes hash
Return
$ObjectID (string)
the existing object id or undef

id

Returns the SearchTerm id.

Syntax
$SearchTermID = $SearchTerm->id;
Return
$SearchTermID (int)
search term id

importXML

Imports an object from an XML file. This function is called at the XML start tag.

Syntax
$Object = DE_EPAGES::Search::API::Object::SearchTerm->importXML($Handler, $hElement, $Class, $hAttributes);
Input
$Handler (object)
xml import handler with support function addObject
$hElement (ref.hash)
XML element structure, see XML::SAX
$Class (object)
class object; the new object will be an instance of this class
$hAttributes (ref.hash)
attributes hash
Return
$Object (object)
the imported object

insert

Insert this info as object, afterwards the hook 'OBJ_InsertSearchTerm' is triggered.

Syntax
$SearchTerm = DE_EPAGES::Search::API::Object::SearchTerm->insert($hInfo);
Example
my $Class = LoadClassByAlias('SearchTerm');
my $SearchTerm = $Class->insertObject($hInfo);
Input
$hInfo (ref.hash)
attributes of new object
Return
$SearchTerm (object)
new object
Hook
OBJ_InsertSearchTerm
hook parameter keys :
  • Object - this object - object
  • SearchTermID - search term id - int

primaryKey

Returns the name of the primary key.

Syntax
$PrimaryKey = $SearchTerm->primaryKey;
Return
$PrimaryKey (String)
primimary key

set

This function triggers hooks 'OBJ_BeforeUpdateSearchTerm' and 'OBJ_AfterUpdateSearchTerm'.

Syntax
$SearchTerm->set($hValues, $LanguageID);
Input
$hValues (ref.hash)
attribute name => value hash
$LanguageID (int)
(optional; required for localized attributes) language id
Hook
OBJ_BeforeUpdateSearchTerm
hook parameter keys :
  • Object - this object - object
  • SearchTermID - search term id - int
  • Values - new values for object - ref.hash
  • LanguageID - values of this language will be updated - int
OBJ_AfterUpdateSearchTerm
hook parameter keys :
  • Object - this object - object
  • SearchTermID - search term id - int
  • Values - updated values - ref.hash
  • LanguageID - values updated of this language - int