[Dbix-class] Join Myself?

Fernan Aguero fernan.aguero at gmail.com
Fri Jul 6 19:35:05 GMT 2012


On Fri, Jul 6, 2012 at 3:33 PM, Steve Wells <wells at cedarnet.org> wrote:
>
> I'm trying to convert this SQL statement to DBIC and I'm failing miserably.


Not a lot of magic required, see 'Joining to the same table twice' in
http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Joining.pod

For joining a table to itself, you shouldn't need anything fancy in
your schema classes.

Just call something like

$model->(db::table1)->search(
 { column => $value },
 { join => 'table1', alias => 'meagain' }
);

when you want to search/join.

--
fernan



More information about the DBIx-Class mailing list