insert($row); } catch (\Exception $e) { // setting already exists, just ignore it if ($e->getCode() === 23000) { continue; } } } } }