library/Services/ShopObjectConstructor/Constructor/ObjectConstructor.php
protected function _getLastInsertedId()
    {
        $objectId = null;
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

        $tableName = $this->getObject()->getCoreTableName();
        $query = 'SELECT OXID FROM '. $tableName .' ORDER BY OXTIMESTAMP DESC LIMIT 1';
        $result = $oDb->select($query);

        if ($result != false && $result->count() > 0) {
            $fields = $result->fields;
            $objectId = $fields['OXID'];
        }

        return $objectId;
    }
protected function _getLastInsertedId()
    {
        $objectId = null;
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

        $tableName = $this->getObject()->getCoreTableName();
        $query = 'SELECT OXID FROM '. $tableName .' ORDER BY OXTIMESTAMP DESC LIMIT 1';
        $result = $oDb->select($query);

        if ($result != false && $result->count() > 0) {
            $fields = $result->fields;
            $objectId = $fields['OXID'];
        }

        return $objectId;
    }
protected function _getLastInsertedId ( ) { $ objectId = null ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ tableName = $ this -> getObject ( ) -> getCoreTableName ( ) ; $ query = 'SELECT OXID FROM ' . $ tableName . ' ORDER BY OXTIMESTAMP DESC LIMIT 1' ; $ result = $ oDb -> select ( $ query ) ; if ( $ result != false && $ result -> count ( ) > 0 ) { $ fields = $ result -> fields ; $ objectId = $ fields [ 'OXID' ] ; } return $ objectId ; }
Get id of latest created row.

@return string|null
Get id of latest created row .