| Fey-ORM documentation | Contained in the Fey-ORM distribution. |
Fey::ORM::Schema - Provides sugar for schema-based classes
version 0.43
package MyApp::Schema; use Fey::ORM::Schema; has_schema ...; no Fey::ORM::Schema;
Use this class to associate your class with a schema. It exports a number of sugar functions to allow you to define things in a declarative manner.
This package exports the following functions:
Given a Fey::Schema object, this method associates that schema with the calling class.
Dave Rolsky <autarch@urth.org>
This software is copyright (c) 2011 by Dave Rolsky.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Fey-ORM documentation | Contained in the Fey-ORM distribution. |
package Fey::ORM::Schema; BEGIN { $Fey::ORM::Schema::VERSION = '0.43'; } use strict; use warnings; use namespace::autoclean; use Fey::Meta::Class::Schema; use Fey::Object::Schema; use Moose 1.15 (); use MooseX::StrictConstructor 0.13 (); use Moose::Exporter; use MooseX::Params::Validate qw( pos_validated_list ); Moose::Exporter->setup_import_methods( with_meta => [qw( has_schema )], also => [ 'Moose', 'MooseX::StrictConstructor' ], ); sub init_meta { shift; my %p = @_; return Moose->init_meta( %p, base_class => 'Fey::Object::Schema', metaclass => 'Fey::Meta::Class::Schema', ); } sub has_schema { my $meta = shift; my ($schema) = pos_validated_list( \@_, { isa => 'Fey::Schema' } ); $meta->_associate_schema($schema); } 1; # ABSTRACT: Provides sugar for schema-based classes
__END__