Re: [Dbix-class] Extended JOIN syntax

2012-02-01 Thread Peter Rabbitson
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

[Dbix-class] Extended JOIN syntax

2012-01-29 Thread Bernhard Graf
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;

Re: [Dbix-class] Extended JOIN syntax

2012-01-29 Thread Bernhard Graf
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

Re: [Dbix-class] Extended JOIN syntax

2012-01-29 Thread Peter Rabbitson
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 {

Re: [Dbix-class] Extended JOIN syntax

2012-01-29 Thread Peter Rabbitson
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 =

Re: [Dbix-class] Extended JOIN syntax

2012-01-29 Thread Bernhard Graf
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.

Re: [Dbix-class] Extended JOIN syntax

2012-01-29 Thread Bernhard Graf
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: