source/Core/GenericImport/ImportObject/ImportObject.php
protected function getOxidFromKeyFields($data)
    {
        if (!is_array($this->getKeyFields())) {
            return null;
        }

        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $queryWherePart = [];
        $allKeysExists = true;
        foreach ($this->getKeyFields() as $key) {
            if (array_key_exists($key, $data)) {
                $queryWherePart[] = $key . '=' . $database->quote($data[$key]);
            } else {
                $allKeysExists = false;
            }
        }

        if ($allKeysExists) {
            $query = 'SELECT OXID FROM ' . $this->getTableName() . ' WHERE ' . implode(' AND ', $queryWherePart);

            return $database->getOne($query);
        }

        return null;
    }
protected function getOxidFromKeyFields($data)
    {
        if (!is_array($this->getKeyFields())) {
            return null;
        }

        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $queryWherePart = [];
        $allKeysExists = true;
        foreach ($this->getKeyFields() as $key) {
            if (array_key_exists($key, $data)) {
                $queryWherePart[] = $key . '=' . $database->quote($data[$key]);
            } else {
                $allKeysExists = false;
            }
        }

        if ($allKeysExists) {
            $query = 'SELECT OXID FROM ' . $this->getTableName() . ' WHERE ' . implode(' AND ', $queryWherePart);

            return $database->getOne($query);
        }

        return null;
    }
protected function getOxidFromKeyFields ( $ data ) { if ( ! is_array ( $ this -> getKeyFields ( ) ) ) { return null ; } $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ queryWherePart = [ ] ; $ allKeysExists = true ; foreach ( $ this -> getKeyFields ( ) as $ key ) { if ( array_key_exists ( $ key , $ data ) ) { $ queryWherePart [ ] = $ key . '=' . $ database -> quote ( $ data [ $ key ] ) ; } else { $ allKeysExists = false ; } } if ( $ allKeysExists ) { $ query = 'SELECT OXID FROM ' . $ this -> getTableName ( ) . ' WHERE ' . implode ( ' AND ' , $ queryWherePart ) ; return $ database -> getOne ( $ query ) ; } return null ; }
Returns oxid of this data type from key fields.

@param array $data Data for object.

@return string
Returns oxid of this data type from key fields .