Name : perl-Catalyst-Model-DBIC-Schema
| |
Version : 0.660.0
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp156.3.1
| Date : 2024-08-25 00:39:38
|
Group : Unspecified
| Source RPM : perl-Catalyst-Model-DBIC-Schema-0.660.0-lp156.3.1.src.rpm
|
Size : 0.10 MB
| |
Packager : https://www_suse_com/
| |
Summary : DBIx::Class::Schema Model Class
|
Description :
This is a Catalyst Model for DBIx::Class::Schema-based Models. See the documentation for Catalyst::Helper::Model::DBIC::Schema for information on generating these Models via Helper scripts.
When your Catalyst app starts up, a thin Model layer is created as an interface to your DBIC Schema. It should be clearly noted that the model object returned by \'$c->model(\'FilmDB\')\' is NOT itself a DBIC schema or resultset object, but merely a wrapper proving methods to access the underlying schema.
In addition to this model class, a shortcut class is generated for each source in the schema, allowing easy and direct access to a resultset of the corresponding type. These generated classes are even thinner than the model class, providing no public methods but simply hooking into Catalyst\'s model() accessor via the ACCEPT_CONTEXT mechanism. The complete contents of each generated class is roughly equivalent to the following:
package MyApp::Model::FilmDB::Actor sub ACCEPT_CONTEXT { my ($self, $c) = AATT_; $c->model(\'FilmDB\')->resultset(\'Actor\'); }
In short, there are three techniques available for obtaining a DBIC resultset object:
my $rs = $c->model(\'FilmDB\')->schema->resultset(\'Actor\');
my $rs = $c->model(\'FilmDB\')->resultset(\'Actor\');
my $rs = $c->model(\'FilmDB::Actor\');
In order to add methods to a DBIC resultset, you cannot simply add them to the source (row, table) definition class; you must define a separate custom resultset class. This is just a matter of making a \'lib/MyApp/Schema/ResultSet/Actor.pm\' class that inherits from DBIx::Class::ResultSet, if you are using DBIx::Class::Schema/load_namespaces, the default for helper script generated schemas.
See DBIx::Class::Manual::Cookbook/\"Predefined searches\" for information on definining your own DBIx::Class::ResultSet classes for use with DBIx::Class::Schema/load_classes, the old default.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl/15.6/noarch |