$existing = Model_Inventory_Import::find('all');
foreach($existing as $ex)
{
$ex->delete();
}
protected static $_many_many = array(
'equipment' => array(
'key_from' => 'vin',
'key_through_from' => 'vehicle_vin',
'table_through' => 'inventory_equipment_association',
'key_through_to' => 'equipment_id',
'model_to' => 'Model_Inventory_Equipment',
'key_to' => 'equipment_id',
'cascade_save' => true,
'cascade_delete' => false,
)
);
protected static $_many_many = array(
'vehicles' => array(
'key_from' => 'equipment_id',
'key_through_from' => 'equipment_id',
'table_through' => 'inventory_equipment_association',
'key_through_to' => 'vehicle_vin',
'model_to' => 'Model_Inventory_Main',
'key_to' => 'vin',
'cascade_save' => true,
'cascade_delete' => false,
),
'vehicles2' => array(
'key_from' => 'equipment_id',
'key_through_from' => 'equipment_id',
'table_through' => 'inventory_equipment_association',
'key_through_to' => 'vehicle_vin',
'model_to' => 'Model_Inventory_Import',
'key_to' => 'vin',
'cascade_save' => true,
'cascade_delete' => false,
)
);
It looks like you're new here. If you want to get involved, click one of these buttons!