1 package Rose
::DBx
::Object
::I18N
::Manager
;
6 use base
'Rose::DB::Object::Manager';
8 use Rose
::DBx
::Object
::I18N
::Helpers
':all';
10 use Hash
::Merge
'merge';
16 if ( my $language = (delete $args{ i18n
} || $class->i18n_language()) ) {
17 my $rel_name = $class->object_class->meta->i18n_translation_rel_name();
19 my ( $rel ) = grep { $_->name => $rel_name }
20 $class->object_class->meta->relationships;
22 my ( $i18n_lang ) = grep { $_->type eq 'i18n_language' }
23 $rel->foreign_class->meta->columns;
24 my $i18n_lang_column = $i18n_lang->name;
26 my $new_args = merge
{
27 query
=> [ "$rel_name.$i18n_lang_column" => $language ],
28 with_objects
=> [ $rel_name ]
35 $class->SUPER::get_objects
( %args );
38 =head1 COPYRIGHT & LICENSE
40 Copyright 2008 Viacheslav Tikhanovskii, all rights reserved.
42 This program is free software; you can redistribute it and/or modify it
43 under the same terms as Perl itself.