source/Core/Model/BaseModel.php
protected function _insert()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();

        // let's get a new ID
        if (!$this->getId()) {
            $this->setId();
        }

        $idKey = $myUtils->getArrFldName($this->getCoreTableName() . '.oxid');
        $this->$idKey = new Field($this->getId(), Field::T_RAW);
        $insertSql = "Insert into {$this->getCoreTableName()} set ";

        $shopIdField = $myUtils->getArrFldName($this->getCoreTableName() . '.oxshopid');

        if ($this->isPropertyLoaded($shopIdField)
            && (!$this->isPropertyField($shopIdField) || !$this->$shopIdField->value)
        ) {
            $this->$shopIdField = new Field(
                $myConfig->getShopId(),
                Field::T_RAW
            );
        }

        $insertSql .= $this->_getUpdateFields($this->getUseSkipSaveFields());

        return $result = (bool) $this->executeDatabaseQuery($insertSql);
    }
protected function _insert()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();

        // let's get a new ID
        if (!$this->getId()) {
            $this->setId();
        }

        $idKey = $myUtils->getArrFldName($this->getCoreTableName() . '.oxid');
        $this->$idKey = new Field($this->getId(), Field::T_RAW);
        $insertSql = "Insert into {$this->getCoreTableName()} set ";

        $shopIdField = $myUtils->getArrFldName($this->getCoreTableName() . '.oxshopid');

        if ($this->isPropertyLoaded($shopIdField)
            && (!$this->isPropertyField($shopIdField) || !$this->$shopIdField->value)
        ) {
            $this->$shopIdField = new Field(
                $myConfig->getShopId(),
                Field::T_RAW
            );
        }

        $insertSql .= $this->_getUpdateFields($this->getUseSkipSaveFields());

        return $result = (bool) $this->executeDatabaseQuery($insertSql);
    }
protected function _insert ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ myUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; // let's get a new ID if ( ! $ this -> getId ( ) ) { $ this -> setId ( ) ; } $ idKey = $ myUtils -> getArrFldName ( $ this -> getCoreTableName ( ) . '.oxid' ) ; $ this -> $ idKey = new Field ( $ this -> getId ( ) , Field :: T_RAW ) ; $ insertSql = "Insert into {$this->getCoreTableName()} set " ; $ shopIdField = $ myUtils -> getArrFldName ( $ this -> getCoreTableName ( ) . '.oxshopid' ) ; if ( $ this -> isPropertyLoaded ( $ shopIdField ) && ( ! $ this -> isPropertyField ( $ shopIdField ) || ! $ this -> $ shopIdField -> value ) ) { $ this -> $ shopIdField = new Field ( $ myConfig -> getShopId ( ) , Field :: T_RAW ) ; } $ insertSql .= $ this -> _getUpdateFields ( $ this -> getUseSkipSaveFields ( ) ) ; return $ result = ( bool ) $ this -> executeDatabaseQuery ( $ insertSql ) ; }
Insert this Object into the database, this function only works
on the main table, it will not save any dependent tables, which
might be loaded through oxlist.

@return bool
Insert this Object into the database this function only works on the main table it will not save any dependent tables which might be loaded through oxlist .