protected function createCountries()
    {
        $rows = $placeholders = array();

        foreach ((array) $this->getCountryModel()->getIso() as $code => $country) {
            $placeholders[] = '(?,?,?,?,?)';
            $native_name = empty($country['native_name']) ? $country['name'] : $country['native_name'];
            $rows = array_merge($rows, array(0, $country['name'], $code, $native_name, serialize(array())));
        }

        $values = implode(',', $placeholders);
        $sql = "INSERT INTO country (status, name, code, native_name, format) VALUES $values";
        $this->db->run($sql, $rows);
    }
protected function createCountries()
    {
        $rows = $placeholders = array();

        foreach ((array) $this->getCountryModel()->getIso() as $code => $country) {
            $placeholders[] = '(?,?,?,?,?)';
            $native_name = empty($country['native_name']) ? $country['name'] : $country['native_name'];
            $rows = array_merge($rows, array(0, $country['name'], $code, $native_name, serialize(array())));
        }

        $values = implode(',', $placeholders);
        $sql = "INSERT INTO country (status, name, code, native_name, format) VALUES $values";
        $this->db->run($sql, $rows);
    }
protected function createCountries ( ) { $ rows = $ placeholders = array ( ) ; foreach ( ( array ) $ this -> getCountryModel ( ) -> getIso ( ) as $ code => $ country ) { $ placeholders [ ] = '(?,?,?,?,?)' ; $ native_name = empty ( $ country [ 'native_name' ] ) ? $ country [ 'name' ] : $ country [ 'native_name' ] ; $ rows = array_merge ( $ rows , array ( 0 , $ country [ 'name' ] , $ code , $ native_name , serialize ( array ( ) ) ) ) ; } $ values = implode ( ',' , $ placeholders ) ; $ sql = "INSERT INTO country (status, name, code, native_name, format) VALUES $values" ; $ this -> db -> run ( $ sql , $ rows ) ; }
Creates countries from ISO list
Creates countries from ISO list