Bernhard Graf wrote:
Am 29.01.2012 21:52, schrieb Peter Rabbitson:
It is possible, but is not yet particularly pretty. The trick is
that the coderef in question is called every time the relationship
needs to be resolved. By referencing some external package-global
you can control what the
I have just learned, that the JOIN syntax was improved recently, so it
is possible to specify more than just the equality of column values, as
shown in the example from DBIx::Class::Relationship::Base:
My::Schema::Artist-has_many(
cds_80s = 'My::Schema::CD',
sub {
my $args = shift;
Am 29.01.2012 20:42, schrieb Bernhard Graf:
The example above still requires the bind values to be defined
statically in the schema. I couldn't find any examples, about how to
specify bind values at execution time - e.g. likes this:
My::Schema::Artist-has_many(
cds_era = 'My::Schema::CD',
sub
Bernhard Graf wrote:
I have just learned, that the JOIN syntax was improved recently, so it
is possible to specify more than just the equality of column values, as
shown in the example from DBIx::Class::Relationship::Base:
My::Schema::Artist-has_many(
cds_80s = 'My::Schema::CD',
sub {
Bernhard Graf wrote:
Am 29.01.2012 20:42, schrieb Bernhard Graf:
The example above still requires the bind values to be defined
statically in the schema. I couldn't find any examples, about how to
specify bind values at execution time - e.g. likes this:
My::Schema::Artist-has_many(
cds_era =
Am 29.01.2012 21:52, schrieb Peter Rabbitson:
It is possible, but is not yet particularly pretty. The trick is
that the coderef in question is called every time the relationship
needs to be resolved. By referencing some external package-global
you can control what the coderef will return.
Correction:
$artist_rs-result_class-era_begin(1979);
$artist_rs-result_class-era_end(1990);
$artist_rs-search_related('cds_era')-next;
Bernhard
___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: