[CDBI] has_many - how to specify link columns ?

Ryan Tate lists at ryantate.com
Tue Aug 15 20:47:52 BST 2006

On 8/15/06, Michael Reece <mreece at vinq.com> wrote:
>   articles->has_many( prices => 'prive2articles' => 'artid' );  # third
> argument is 'my key in foreign table'

The third argument to has_many should not be needed, assuming
price2articles class properly sets up has_a relationship with articles
class, i.e.:

$price2articles_class->has_a( artid => $article_class );
$article_class->has_many( prices => $price2articles_class );

By the way, why not just rename the "price2articles" table "prices?"
Seems a lot simpler.

More information about the ClassDBI mailing list