DBIx::Class::ServiceManager - Load DBIx::Class::Service objects and create accessor for services.
version 0.02
In your schema:
package MySchema::Schema; use strict; use warnings; use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; __PACKAGE__->load_components(qw/ServiceManager/); __PACKAGE__->load_services({ 'MySchema::Service' => [qw/ User /] }); 1;
Accessor for DBIx::Class::ServiceProxy classes. The access key is suffix of each service class name.
Load services from pair of class prefix and service class suffixes. Default prefix value is added "::Service" end of the service class name.
If the schema class called "MySchema::Schema", then the default prefix is "MySchema::Schema::Service".
The prefix is default. Each item in the array is service class suffix.
package MySchema::Schema; use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; __PACKAGE__->load_components(qw/ServiceManager/); __PACKAGE__->load_service(qw/User Diary/); ### Loads MySchame::Schema::Service::User, MySchame::Schema::Service::Diary
Same behavior as using ARRAY.
Use each keys of HASHREF as service class prefix. Each values must be ARRAYREF include class name suffixes.
package MySchema::Schema; use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; __PACKAGE__->load_components(qw/ServiceManager/); __PACKAGE__->load_services({ 'MySchema::Service' => [qw/ User Diary /] }); ### Loads MySchame::Service::User, MySchame::Service::Diary
Register service classes. (internal)
Toru Yamaguchi, <zigorou@cpan.org>
<zigorou@cpan.org>
Please report any bugs or feature requests to bug-dbix-class-servicemanager@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-dbix-class-servicemanager@rt.cpan.org
Copyright 2008 Toru Yamaguchi, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DBIx::Class::Service, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::Service
CPAN shell
perl -MCPAN -e shell install DBIx::Class::Service
For more information on module installation, please visit the detailed CPAN module installation guide.