Catalyst::TraitFor::Model::DBIC::Schema::PerRequestSchema(3pm)

Catalyst::TraitFor::Model::DBIC::Schema::PerRequestSchema3pm

Clone the schema with attributes for each requests

Usage

    __PACKAGE__->config({
        traits => ['PerRequestSchema'],
    });
    sub per_request_schema_attributes {
        my ($self, $c) = @_;
        return (restricting_object => $c->user->obj);
    }
    ### OR ###
    sub per_request_schema {
        my ($self, $c) = @_;
        return $self->schema->schema_method($c->user->obj)
    }

Overview

Clones the schema for each new request with the attributes retrieved from your "per_request_schema_attributes" method, which you must implement. This method is passed the context.

Alternatively, you could also override the "per_request_schema" method if you need access to the schema clone and/or need to separate out the Model/Schema methods. (See examples above and the defaults in the code.)

Releases

7 releases since Debian 7 (Wheezy); the text changed 4 times.

  1. 7
  2. 8–10
  3. 11
  4. 12
  5. 13

Author

See "AUTHOR" in Catalyst::Model::DBIC::Schema and "CONTRIBUTORS" in Catalyst::Model::DBIC::Schema.

License

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

From libcatalyst-model-dbic-schema-perl 0.66-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.