ePages 6.11.0 - DE_EPAGES/Presentation/API/Object/Tray.pm

Package DE_EPAGES::Presentation::API::Object::Tray

object interface to object tray of session.
The tray is used to select objects and transfer them between different pages in the back-office.

Base
DE_EPAGES::Core::API::Object::BaseObject

Functions

addObjectsToClassGroup
addObjectsToGroup
delete
deleteGroup
groups
load
objects
objectsByClass
objectsByGroup
setGroup

addObjectsToClassGroup

Adds a list objects to the tray. The objects are automatically assigned to groups with the name of the object's classes, for example 'Tent', 'Jacket' etc..

Syntax
$Tray->addObjectsToClassGroup( $aObjects );
Example
$Tray->addObjectsToGroup( \@Products );
Input
$aObjects (ref.array.object)
list of objects

addObjectsToGroup

Adds objects to the tray.

Syntax
$Tray->addObjectsToGroup( $TrayGroupID, $aObjects );
Example
$Tray->addObjectsToGroup( $Tray->setGroup('Products'), [ $Product ] );
Input
$TrayGroupID (integer)
tray group id
$aObjects (ref.array.object)
list of objects

delete

Deletes this object

Syntax
$Object->delete;

deleteGroup

Deletes a group of objects from the tray.

Syntax
$Tray->deleteGroup( $TrayGroupID );
Example
$Tray->deleteGroup( $Tray->setGroup( 'Products') );
Input
$TrayGroupID (integer)
tray group id

groups

Returns the groups of objects that are currenty in the tray.

Syntax
$ahTrayGroups = $Tray->groups;
Return
$ahTrayGroups (ref.array.hash)
tray groups with keys:
  • TrayGroupID - tray group id (primary key)- int
  • IntSessionID - internal session id - int
  • Position - position of group - int
  • Name - name of group - string
  • CountElements - count of objects in group - int

load

Returns the tray object of the session.

Syntax
$Tray = DE_EPAGES::Presentation::API::Object::Tray->load( $IntSessionID );
Input
$IntSessionID (integer)
internal session id
Return
$Tray (object)
tray object

objects

Returns all objects that are currently in the tray.

Syntax
$aObjects = $Tray->objects;
Return
$aObjects (ref.array.object)
list of objects

objectsByClass

Returns all objects from the tray that are instances of a class.

Syntax
$aObjects = $Tray->objectsByClass( $Class );
Example
$aProducts = $Tray->objectsByClass( LoadClassByAlias('Product') );
Input
$Class (object)
class object
Return
$aObjects (ref.array.object)
list of objects

objectsByGroup

Returns all objects of a tray group.

Syntax
$aObjects = $Tray->objectsByGroup( $TrayGroupID );
Example
$aProducts = $Tray->objectsByGroup( $Tray->setGroup( 'Products') );
Input
$TrayGroupID (integer)
tray group id
Return
$aObjects (ref.array.object)
list of objects

setGroup

Returns the group id by group name. Creates a new group if the group name does not yet exist in the tray.

Syntax
$TrayGroupID = $Tray->setGroup( $Name );
Example
$TrayGroupID = $Tray->setGroup( 'Products' );
Input
$Name (string)
trag group name
Return
$TrayGroupID (integer)
tray group id