When I delete a 'type' i set isActive = 0;
Every 'type' 'has many' 'causal'
So when disabling a type i want disable every causal
in type controller i'm trying this
$model = $this->loadModel($id);
$model->isActive = 0;
foreach ($model->causalsObj as $key => $causal ) {
$causal = CausalController::delete($causal->id);
}
$model->save();
This doesn't work (PHP error during ajax call)