Toru Yamaguchi > DBIx-Class-Service-0.02 > DBIx::Class::ServiceManager

Download:
DBIx-Class-Service-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

DBIx::Class::ServiceManager - Load DBIx::Class::Service objects and create accessor for services.

VERSION ^

version 0.02

SYNOPSIS ^

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;

METHODS ^

service($service_name)

Accessor for DBIx::Class::ServiceProxy classes. The access key is suffix of each service class name.

load_services(@args)

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".

ARRAY

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
ARRAYREF

Same behavior as using ARRAY.

HASHREF

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($base, $services)

Register service classes. (internal)

SEE ALSO ^

DBIx::Class::Service
DBIx::Class::ServiceProxy

AUTHOR ^

Toru Yamaguchi, <zigorou@cpan.org>

BUGS ^

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.

COPYRIGHT & LICENSE ^

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.

syntax highlighting: