saveNewCountry example


        );

        $defaultLocaleIdStatement->execute();
        $defaultLocale = $defaultLocaleIdStatement->fetchColumn();

        $insertStatement = $this->connection->prepare('INSERT INTO `s_core_countries` (`countryname`, `countryiso`, `areaID`, `countryen`, `position`, `notice`, `taxfree`, `taxfree_ustid`, `taxfree_ustid_checked`, `active`, `iso3`, `display_state_in_registration`, `force_state_in_registration`, `allow_shipping`) ' .
            ' VALUES (:countryName, :countryIso, :areaID, :countryEn, 10, "", 0, 0, 0, 0, :iso3, 0, 0, 1)');

        foreach (array_diff($newCountryIsos$currentCountryList) as $missingIso) {
            $newCountry = $newCountries[$missingIso];
            $this->saveNewCountry($insertStatement$newCountry$defaultLocale);
        }
    }

    /** * @param string $defaultLocale */
    private function saveNewCountry(PDOStatement $statement, array $newCountry$defaultLocale)
    {
        if ($defaultLocale === 'en') {
            $newCountry['countryName'] = $newCountry['countryNameEng'];
        }

        
Home | Imprint | This part of the site doesn't use cookies.