[Dbix-class] What should DBIC objects stringify to?

phaylon phaylon at dunkelheit.at
Wed May 3 16:54:34 CEST 2006


Alan Humphrey said:
>
> Perhaps:
>
> $obj = $schema->('Table')->find({whatever})->first;
> if ( $obj ) {
>
> } else {
>
> }

Won't do. ->find wants the primary key(s) and returns a row, not a
resultset, which would provide the ->first. So it's either
->search(...)->first, ->single(...) or ->find( $pk )

hth, p




More information about the Dbix-class mailing list