Zbigniew Lukasiak pisze:
> 2009/5/12 Paweł Tęcza <[email protected]>:

>> So my question is: how can I modify my model to get the study details
>> in the following, more "natural" way?  Is it possibble at all?
>>
>> my @studies = $c->model('DB::Studies')->all;
>> foreach my $study in (@studies) {
>>    $study_name        = $study.study_datas.name        || '';
>>    $study_description = $study.study_datas.description || '';
>>    $study_program     = $study.study_datas.program     || '';
>>    $study_email       = $study.study_datas.email       || '';
>> }
>>
>
> Hmm - there is something missing there - according to your description
> above $study.study_datas.program can not identify one value - but
> rather an array of values (one for each language) isn't that true?
>
> You might also want to change the '.' to '->'.

Hi Zbyszek,

Thanks for your reply! Of course, you're absolutely right. I have to
choose one language when I get all study details via my model. Sorry for
confusing, but I rather wanted to show my problem than working snippet ;)

Do you know solution of that issue? Maybe I should define subroutines in
MyApp::Schema::ResultSet::Studies module for all type of data?

Have a nice day,

P.

PS. I still remember your and Dexter presentation titled "Modern Perl"
at the Faculty of Mathematics Informatics and Mechanics at the
University of Warsaw in February :D

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to