Name

CatalystX::Usul::File::ResultSet - Core element methods

Version

0.3.$Revision: 576 $

Synopsis

my $app;     # The Catalyst application object
my $attrs  = { schema_attributes => $schema_attributes };
my $source = CatalystX::Usul::File::ResultSource->new( $app, $attrs ) );
my $rs     = $source->resultset( $path, $lang );
my $result = $rs->search( $criterion );

for $element_obj ($result->next) {
   # Do something with the element object
}

Description

Find, search and update methods for element objects

Subroutines/Methods

new

Constructor returns a result set object

all

@elements = $rs->search()->all;

Returns all the elements that are returned by the "search" call

create

$element_obj = $rs->create( $attrs );

Creates and returns a new element object from the attributes provided

find

$element_obj = $rs->find( $name );

Finds the named element and returns an element object for it

find_and_update

$element_obj = $rs->find_and_update( $name, $attrs );

Finds the named element object and updates it's attributes

first

$element_obj = $rs->search( $criterion )->first;

Returns the first element object that is the result of the search call

get_list

$list = $rs->get_list( $name );

Returns a list object

last

$element_obj = $rs->search( $criterion )->last;

Returns the last element object that is the result of the search call

next

$element_obj = $rs->search( $criterion )->next;

Iterate over the elements returned by the search call

push_attribute

($attrs, $added) = $rs->push_attribute( $name, $list, $items );

Adds items to the attribute list

schema

$schema = $rs->schema;

Returns the source schema object

$result = $rs->search( $criterion );

Search for elements that match the given criterion. The criterion is a hash ref whose keys are element attribute names. The criterion values are either scalar values or hash refs. The scalar values are tested for equality with the corresponding element attribute values. Hash ref keys are treated as comparison operators, the hash ref values are compared with the element attribute values, e.g.

$criterion = { quick_links => { '>=' => 0 } };

splice_attribute

($attrs, $removed) = $rs->splice_attribute( $name, $list, $items );

Removes items from the attribute list

storage

Returns the schema storage object

Diagnostics

None

Configuration and Environment

None

Dependencies

CatalystX::Usul
CatalystX::Usul::File::Element
CatalystX::Usul::File::List

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Copyright (c) 2008 Peter Flanigan. All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE