[Dbix-class] about "search" and "find" ...

Daniel McBrearty danielmcbrearty at gmail.com
Fri Jun 16 16:41:25 CEST 2006


I'm not really getting the difference from reading

http://search.cpan.org/~jrobinson/DBIx-Class-0.06003/lib/DBIx/Class/ResultSet.pm#METHODS

also :

"
Also takes an optional key attribute, to search by a specific key or
unique constraint. For example:

  my $cd = $schema->resultset('CD')->find(
    {
      artist => 'Massive Attack',
      title  => 'Mezzanine',
    },
    { key => 'artist_title' }
  );
"

I don't get this - this is looking for an album where artist and title
have the given values ... so what is the key doing, in terms of the
actual query?

thanks

Daniel



-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131



More information about the Dbix-class mailing list