So I wrote following:
protected static $_has_many = array(
'appearance' => array(
'key_from' => 'weapon_id',
'model_to' => 'Appearance',
'key_to' => 'weapon_id',
'cascade_save' => false,
'cascade_delete' => false,
),
'combo' => array(
'key_from' => 'category_id',
'model_to' => 'Combo',
'key_to' => 'category_id',
'cascade_save' => false,
'cascade_delete' => false,
),
);
$weapons = \Model\M\Close\Weapon::find('all', array('related' => array(
'appearance',
'combo',
)));
$weapons = \Fuel\Core\Format::forge($weapons)->to_array();
Weapon ORM object returns both successfully.
Appearance is simply a list of appearance object,
but combo became Key Value Pair array of combo object with key as combo_order.
So something like this:
'Weapon' => { 'appearance' => [ {'a'=>'b'} ],
'combo' => [ 'evolve_order' => {'a'=>'b'} ],
}
It looks like you're new here. If you want to get involved, click one of these buttons!