perl - Retrieving related data from Result object -


i have following relationship on entry result class:

package schema::result::entry; __package__->has_many(   "entry_i18ns",   "schema::result::entryi18n",   { "foreign.entry_id" => "self.id" },   { cascade_copy => 0, cascade_delete => 0 }, ); 

so want retrieve related data newly created schema::result::entry object:

$result = $schema->resultset('result')->create({ entry_i18ns => { title => 'foo', language_code => 'en' } }); 

the problem entry_i18ns accessor executes select , returns related entryi18n objects, not specific 1 created create() call.

as far can see, data need stored $result->{_relationship_data}{entry_i18ns} array ref can access whith like

my $related_data = $result->{_relationship_data}{entry_i18ns}[0]{_column_data}; 

but how can without messing internal dbic private storage?

no accessor in dbic. accessors “multi” relationship always new select. can create own component adds accessor. or add method result class.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -