[Dbix-class] schema problems...

Josef Chladek j.chladek at wirtschaftsblatt.at
Wed Aug 9 14:56:22 CEST 2006


Am 09.08.2006 um 14:39 schrieb Christopher H. Laco:

> Josef Chladek wrote:
>> hi list,
>>
>> we are porting a CDBI setup to DBIC and having the following problem:
>> ....
>> how can I avoid writing the Matrix schema under Calendar?
>>
>> what works is
>> warn $r->{_column_data}->{matrix_id};
>>
>> but I don't guess that's the way it should be done?
>>
>> thanks
>> josef
>
> It's early, and I'm not DBIC guru, but from looking at the code, I'm
> assuming your schema class is XMLForm::Schema::Calandar? Can we see  
> that
> code?

well, I found the solution:

package XMLForm::Schema::Calendar;
use base qw/DBIx::Class::Schema/;

__PACKAGE__->load_classes(qw/ Companies Events Persons Weekly/,{
     XMLForm::Schema::Matrix => [qw/ Entries /],
   });
1;

with this setup I'm able to call

my $rs = $model->resultset('Companies')->search(...)

$rs->next->matrix_id

because now the Schema from Matrix is known to the Schema of Calendar

thanks anyway!

josef



More information about the Dbix-class mailing list