The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mixin::ExtraFields::Driver::DBIC - store Mixin::ExtraFields data in a DBIx::Class store

VERSION

version 0.004

DESCRIPTION

This class provides a driver for storing Mixin::ExtraFields data in DBIx::Class storage. You'll need to create a table resultsource for the storage of entires and you'll need to use Mixin::ExtraFields in the class that gets the extras.

So, you might create:

  package My::Schema::ObjectExtra;
  use Mixin::ExtraFields::Driver::DBIC -setup => { table => 'object_extras' };
  1;

...and elsewhere;

  package My::Schema::Object;
  use parent 'DBIx::Class';
  ...
  use Mixin::ExtraFields -fields => {
    driver => { class => 'DBIC', rs_moniker => 'ObjectExtra' }
  };

DRIVER ARGS

The following arguments may be provided when defining the driver when setting up Mixin::ExtraFields:

  schema       - the schema for the DBIx::Class storage (see below)
  rs_moniker   - the moniker of the result source for extras
  id_column    - the name of the column that stores object ids
  name_column  - the name of the column that stores extra field names
  value_column - the name of the column that stores extra field values

schema may be an actual DBIx::Class::Schema object or a coderef which, when called on an object, returns a schema. The default value assumes that objects will be DBIx::Class::Row objects, and returns their schema.

SETUP ARGS

When using Mixin::ExtraFields::Driver::DBIC to set up a table result source, the following values may be in the argument to -setup in the import call:

  table        - (required) the name of the table in the storage
  id_column    - the name of the column that stores object ids
  name_column  - the name of the column that stores extra field names
  value_column - the name of the column that stores extra field values

AUTHOR

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Ricardo SIGNES.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.