Mixin::ExtraFields::Driver::DBIC - store Mixin::ExtraFields data in a DBIx::Class store
version 0.004
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' } };
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.
schema
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:
-setup
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
Ricardo SIGNES <rjbs@cpan.org>
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.
To install Mixin::ExtraFields::Driver::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mixin::ExtraFields::Driver::DBIC
CPAN shell
perl -MCPAN -e shell install Mixin::ExtraFields::Driver::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.