ePages 6.15.1 - DE_EPAGES/Object/API/ObjectArray.pm

Package DE_EPAGES::Object::API::ObjectArray

Helper functions for processing large lists of objects without using up all available memory.

@EXPORT_OK
ObjectIterator
ObjectArray

Functions

ObjectArray
ObjectIterator

ObjectArray

Creates a virtual array of objects baased on an array reference of object ids.

Syntax
$aObjects = ObjectArray( $aObjectIDs );
Example
my $aObjects = ObjectArray( $Parent->findChildren );
say $_->pathString foreach @$aObjects;
Input
$aObjectIDs (ref.array)
array to iterate
Return
$aObjects (DE_EPAGES::Core::API::Iterator)
array of objects

ObjectIterator

Creates an iterator of objects from an array reference of object ids.

Syntax
$Iterator = ObjectIterator( $aObjectIDs );
$Iterator = ObjectIterator( $aObjectIDs, $Handle );
Example
my $Objects = ObjectIterator( $Parent->findChildren );
say $_->pathString while <$Objects>;
Input
$aObjectIDs (ref.array)
array to iterate
$Handle (ref.code)
(optional) function that processes each item
Return
$Iterator (DE_EPAGES::Core::API::Iterator)
iterator of objects