[Dbix-class] load_namespaces with extra resultset base class, without defining each one?

Eden Cardim edencardim at gmail.com
Mon Nov 1 12:15:32 GMT 2010


>>>>> "Oleg" == Oleg Kostyuk <cub.uanic at gmail.com> writes:

    Oleg> Hello, Base classes for your schema is out of scope of
    Oleg> load_namespaces() tasks. Just implement needed for you
    Oleg> hierarchy, with base classes out of your Result and ResultSet
    Oleg> namespaces, and that's all. Something like this:

    Oleg> My::Schema::Base::Result (descendant of DBIx::Class::Core)
    Oleg> |-My::Schema::Result::Books \My::Schema::Result::Authors
    Oleg> My::Schema::Base::ResultSet (descendant of
    Oleg> DBIx::Class::ResultSet) |-My::Schema::ResultSet::Books
    Oleg> \My::Schema::ResultSet::Authors

Result/ResultSet are just default namespaces, you can customize the
namespace you want and even provide multiple namespaces, which will
fulfil the requirements of the OP. See the doc for load_namespaces() in
DBIx::Class::Schema.

-- 
   Eden Cardim       Need help with your Catalyst or DBIx::Class project?
  Code Monkey                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://blog.edencardim.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list