Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Multiple PK's
  • I'm working with a database that was migrated from an older Pervasive database to MySQL. Some database tables have multiple primary keys. Is there a way to specify these in the relational ORM mapping? Something like:
    // in a Model_Post which has many comments
    protected static $_has_many = array(
        'comments' => array(
            'key_from' => array(key1, key2),
            'model_to' => 'Model_Comment',
            'key_to' => array(key1, key2),
            'cascade_save' => true,
            'cascade_delete' => false,
        )
    );
    
  • That should work without any trouble, the system was setup with support for multiple PKs (if it's a string it's cast to array($string)).
  • Awesome, thanks for the quick response Jelmer. I just sat down to start work on it and will give this a shot then. I'll post back if I run into any hiccups.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion