Package DE_EPAGES::Object::API::Object::DALObject
object interface for BaseObjects.
Base |
DE_EPAGES::Core::API::Object::BaseObject |
Functions
- canDelete
- class
- className
- clone
- dal
- dalPackage
- dbPackage
- deleteAttributes
- deleteXML
- exportXMLAttributes
- exportXMLElements
- exportXMLLanguageElements
- exportableAttributes
- findXML
- get
- id
- importXML
- instanceOf
- onDeleteClass
- primaryKey
- recursiveGet
- reset
- set
- slavePrimaryKey
- tagNameXML
- tleHash
- triggerGetHook
canDelete
Tests if the object can be deleted. If there is any reason why the object should not be deleted, these reasons are appended to the @$aWarnings list. Calls DE_EPAGES::Object::API::BaseAttribute::canDeleteObject for each attribute package of the object's class.
Syntax |
$Object->canDelete($aWarnings); |
Example |
my @Warnings; $Object->canDelete( \@Warnings ); if( scalar @Warnings ) { print "Object can't be deleted, because: "; print join( ", ", map { $_->shortMessage } @Warnings ); } else { $Object->delete; } |
Input |
|
class
Returns the class of an object
Syntax |
$Class = $BaseObject->class; |
Return |
|
className
Returns name of class.
Syntax |
$Key = $Package->className(); |
Return |
|
clone
Inserts a new object into the database as copy from old object.
Syntax |
$Clone = $DALObject->clone( $hInfo ); |
Input |
|
Return |
|
dal
Returns name of dal.
Syntax |
$DalPackage = $Package->dal(); |
Return |
|
dalPackage
Returns name of dal.
Syntax |
$DalPackage = $Package->dalPackage(); |
Return |
|
dbPackage
Returns name for this class used by dal.
Syntax |
$DbPackage = $Package->dbPackage(); |
Return |
|
deleteAttributes
Deletes the object attributes. Called by delete.
Syntax |
$Object->deleteAttributes; |
deleteXML
Called by the SAX driver when a start tag for the current object class is encountered. The function identifies the object by the attributes in $hAttributes and deletes the object if it still exists and and the attribute 'delete="1"' is specified.
Syntax |
$Object = DE_EPAGES::Object::API::Object::Object->deleteXML($Handler, $hElement, $hAttributes, $Class); |
Input |
|
Return |
|
exportXMLAttributes
Returns plain attributes of object to XML export driver. This function removes string attributes with newlines, adds object to each level.
Syntax |
$hAttributes = $Object->exportXMLAttributes( $Driver, $hAllAttributes ); |
Input |
|
Return |
|
exportXMLElements
Exports multilinguagal attribute value of this object to the xml SAX driver.
Syntax |
$Object->exportXMLElements($Driver, $hAllAttributes); |
Input |
|
exportXMLLanguageElements
Add xml elements for language dependend attributes (part of exportXMLElements), same as String attributes includes newline.
Syntax |
$Object->exportXMLLanguageElements( $Driver, $hAttributes ); |
Input |
|
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 |
|
findXML
Imports an object from an XML file. This function is called at the XML start tag.
Syntax |
$ObjectID = DE_EPAGES::Object::API::Object::Object->findXML($Handler, $hElement, $Class, $hAttributes); |
Input |
|
Return |
|
get
Returns one or more attribute values.
Syntax |
$Value = $Object->get( $Name, $LanguageID ); $hValues = $Object->get( $aNames, $LanguageID ); |
Example |
$Password = $Object->get( 'Password' ); $Password = $Object->get( ['Login', 'Password'] )->{'Password'}; |
Input |
|
Return |
|
id
Returns the base-object id.
Syntax |
$BaseObjectID = $BaseObject->id; |
Return |
|
importXML
Imports an object from an XML file. This function is called at the XML start tag.
Syntax |
$Object = DE_EPAGES::Object::API::Object::Object->importXML($Handler, $hElement, $Class, $hAttributes); |
Input |
|
Return |
|
instanceOf
Returns true if the object is an instance of the class or one of its sub classes.
Syntax |
$IsInstance = $BaseObject->instanceOf( $Class ) $IsInstance = $BaseObject->instanceOf( $ClassName ) |
Example |
my $ClassProduct = LoadClassByAlias( 'Product' ); if( $Object->instanceOf( $ClassProduct ) ) { ... } if( $Object->instanceOf('Product' ) ) { ... } |
Input |
|
Return |
|
onDeleteClass
Called before the class of this object is deleted. The default implementation calls $self->delete.
Syntax |
$BaseObject->onDeleteClass; |
primaryKey
Returns name of identifier of master table.
Syntax |
$Key = $Package->primaryKey(); |
Return |
|
recursiveGet
Obsolete. Do not use.
reset
Removes internal cache key class.
Syntax |
$Object->reset; |
set
Sets the given attribute values on the object.
Syntax |
$Object->set($hValues, $LanguageID); |
Input |
|
slavePrimaryKey
Returns name of identifier of slave table
Syntax |
$Key = $Package->slavePrimaryKey(); |
Return |
|
tagNameXML
Returns the tag name to use in XML export/import. By default, the tag name is the Alias of the class.
Syntax |
$TagName = $Object->tagNameXML; |
Return |
|
tleHash
Returns a tied hash for the TLE compiler.
Syntax |
$BaseObject->tleHash; |
triggerGetHook
Triggers a hook for $Object->get.
Syntax |
$hValues = $Object->triggerGetHook( $HookName, $aNames, $LanguageID, $Sub ); $Value = $Object->triggerGetHook( $HookName, $Name, $LanguageID, $Sub ); |
Example |
return $self->triggerGetHook('OBJ_GetDownloadProductMap', $aNames, $LanguageID, sub { my ($_aNames, $_LanguageID) = @_; return $self->SUPER::get($_aNames, $_LanguageID) }); |
Input |
|