public function affectedRows($handle, $type) { switch ($type) { case 1: return $handle->getInsertedCount(); break; case 2: return $handle->getModifiedCount(); break; case 3: return $handle->getDeletedCount(); break; default: return false; } }