The startSetup() and endSetup() methods are used in setup scripts. They are often at the beginning and the end of an upgrade/install method, like in “upgrade()” method of Magento/Catalog/Setup/UpgradeData.php The question is “do you really need them?” Or does it just “look necessary”? This blog post explores what these functions do and then explains when you do and do not need to use these methods. Let’s see what these methods are doing. First, startSetup(): public function startSetup() { $this->rawQuery("SET SQL_MODE=''"); $this->rawQuery("SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0"); $this->rawQuery("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"); return $this; } 1. Disable foreign keys check. It may be necessary in some rare cases (for example, in a case of cyclic references between tables), but it’s not needed in common situations. It even may lead to hiding real problems...
find some magento simple technical solution easly get solution with wide explanation. how we can use the solution code. Here i am posting what i faced issues and found issues solving solution. Magento is most powerful eCommerce frame work. working in magento framwork finding soluiotn and sharing technical knowledge here.