Filter.pm


NAME

Communiware::Filter - Implementation of non-sql filter objects.


SYNOPSIS

 $filter = new Commuiniware::Filter([{ITEM_ID=>1},{ITEM_ID=>2}]);
 $filter = new Commuiniware::Filter([{ITEM_ID=>1},{ITEM_ID=>2}],
                                    {ITEM_ID=>['STRING', '']}
                                   );
 $filter -> fetchrow_hashref();
 $filter -> fetchall_arrayref;


DESCRIPTION

Object of type Communiware::Filter mimics some behavoir of DBI statement handles. It should support at least fetchrow_hashref and fetchall_arrayref methods.

Default implementation of Communiware::Filter recieves list of hashes which is result of filter (hash element ITEM_ID required in each hash).

Optional second argument of constructor gives an extra information about attribute types in data array. Format of this information is equal to one returned by type_info method.


METHODS

new

   new Communiware::Filter (listref)

Creates new Communiware::Filter object which contains given list of items.

fetchrow_hashref

Returns next item as reference to hash of attributes and advances internal current row pointer to next row

fetchall_arrayref

Returns all the unfetched items as list of hash references and advances internal pointer behind end of list

finish

Frees most memory used by it.


USING IN TEMPLATES

In order to use custom Communiware::Filter descendants at the template design level, these custom packages should be placed into Communiware::Filter::* namespace.

See Communiware::Unifilters documentation about syntax of non-sql filters in templates.

16 октябрь 2007 13:44