I have the following relationship on my 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 i want to retrieve related data from a newly created Schema::Result::Entry object:
$result = $schema->resultset('Result')->create({ entry_i18ns => { title => 'foo', language_code => 'en' } });
The problem is that entry_i18ns
accessor executes extra SELECT and returns all the related EntryI18n objects, not the specific one which was created with create() call.
As far as i can see, data i need is stored with $result->{_relationship_data}{entry_i18ns}
array ref so i can access it whith something like
my $related_data = $result->{_relationship_data}{entry_i18ns}[0]{_column_data};
But how can i do it without messing up with internal DBIC private storage?