Name

CatalystX::Usul::File::Schema - Base class for schema definitions

Version

0.1.$Revision: 562 $

Synopsis

package CatalystX::Usul::File::ResultSource;

use parent qw(CatalystX::Usul);
use CatalystX::Usul::File::Schema;
use Class::C3;
use Scalar::Util qw(weaken);

__PACKAGE__->config( schema_class => q(CatalystX::Usul::File::Schema) );

__PACKAGE__->mk_accessors( qw(schema schema_class) );

sub new {
   my ($self, $app, $attrs)  = @_;

   my $new = $self->next::method( $app, $attrs );

   $attrs  = { %{ $attrs->{schema_attributes} || {} }, source => $new };

   $new->schema( $new->schema_class->new( $app, $attrs ) );

   weaken( $new->schema->{source} );
   return $new;
}

Description

This is the base class for schema definitions. Each element in a data file requires a schema definition to define it's attributes that should inherit from this

Subroutines/Methods

new

Creates a new instance of the storage class which defaults to CatalystX::Usul::File::Storage

Diagnostics

None

Configuration and Environment

None

Dependencies

CatalystX::Usul
CatalystX::Usul::File::ResultSet
CatalystX::Usul::File::Storage
Scalar::Util

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