File::DataClass::ResultSource - A source of result sets for a given schema
use File::DataClass::Schema; $schema = File::DataClass::Schema->new ( path => [ qw(path to a file) ], result_source_attributes => { source_name => {}, }, tempdir => [ qw(path to a directory) ] ); $schema->source( q(source_name) )->attributes( [ qw(list of attr names) ] ); $rs = $schema->resultset( q(source_name) ); $result = $rs->find( { name => q(id of field element to find) } ); $result->$attr_name( $some_new_value ); $result->update; @result = $rs->search( { 'attr name' => q(some value) } );
Provides new result sources for a given schema
Each element in a data file requires a schema definition to define it's attributes
Defines the following attributes
Array reference of attribute names defined in this result source
A hash reference of attribute names. The values are the defaults for the result class attributes
The name of the result source. Required
An attribute name which, if set, is used by the list class to return a list of labels suitable for display purposes
A hash reference passed to the result constructor
Classname of the result set
A required weak reference to the schema object that is instantiating this result source
A hash reference, keyed by attribute name. The types of the attributes in the result class
@attributes = $self->columns;
Returns a list of attributes
$bool = $self->has_column( $attribute_name );
Predicate return true if the attribute exists, false otherwise
$rs = $self->resultset;
Creates and returns a new File::DataClass::ResultSet object
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
Copyright (c) 2017 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
To install File::DataClass, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::DataClass
CPAN shell
perl -MCPAN -e shell install File::DataClass
For more information on module installation, please visit the detailed CPAN module installation guide.