-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add regions for Albania,Denmark,Greece,Iceland,Portugal and Sweden #30959
Merged
magento-engcom-team
merged 11 commits into
magento:2.4-develop
from
nikolalardev:feature-additional-country-regions
Dec 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0a27db2
Add regions for Albania,Denmark,Greece,Iceland,Portugal and Sweden
nikolalardev 876e37b
#30959 Add one more region for Greece and fix two Portugal states num…
nikolalardev bcbf38d
Merge branch '2.4-develop' into feature-additional-country-regions
8e1d2d7
Merge branch '2.4-develop' into feature-additional-country-regions
c172dc1
#30959 Fix typo
nikolalardev 93b1d30
Merge branch 'feature-additional-country-regions' of github.com:nikol…
nikolalardev 5609fd2
Merge branch '2.4-develop' into feature-additional-country-regions
bf6715d
Merge branch '2.4-develop' into feature-additional-country-regions
d225a17
Merge branch '2.4-develop' into feature-additional-country-regions
engcom-Foxtrot 229ecee
Merge branch '2.4-develop' into feature-additional-country-regions
nikolalardev e8cec3b
Merge branch '2.4-develop' into feature-additional-country-regions
nikolalardev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
app/code/Magento/Directory/Setup/Patch/Data/AddDataForAlbania.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Directory\Setup\Patch\Data; | ||
|
||
use Magento\Directory\Setup\DataInstaller; | ||
use Magento\Directory\Setup\DataInstallerFactory; | ||
use Magento\Framework\Setup\ModuleDataSetupInterface; | ||
use Magento\Framework\Setup\Patch\DataPatchInterface; | ||
|
||
/** | ||
* Add Albania States | ||
*/ | ||
class AddDataForAlbania implements DataPatchInterface | ||
{ | ||
/** | ||
* @var ModuleDataSetupInterface | ||
*/ | ||
private $moduleDataSetup; | ||
|
||
/** | ||
* @var DataInstallerFactory | ||
*/ | ||
private $dataInstallerFactory; | ||
|
||
/** | ||
* AddDataForAlbania constructor. | ||
* | ||
* @param ModuleDataSetupInterface $moduleDataSetup | ||
* @param DataInstallerFactory $dataInstallerFactory | ||
*/ | ||
public function __construct( | ||
ModuleDataSetupInterface $moduleDataSetup, | ||
DataInstallerFactory $dataInstallerFactory | ||
) { | ||
$this->moduleDataSetup = $moduleDataSetup; | ||
$this->dataInstallerFactory = $dataInstallerFactory; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function apply() | ||
{ | ||
/** @var DataInstaller $dataInstaller */ | ||
$dataInstaller = $this->dataInstallerFactory->create(); | ||
$dataInstaller->addCountryRegions( | ||
$this->moduleDataSetup->getConnection(), | ||
$this->getDataForAlbania() | ||
); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Albania states data. | ||
* | ||
* @return array | ||
*/ | ||
private function getDataForAlbania() | ||
{ | ||
return [ | ||
['AL', 'AL-01', 'Berat'], | ||
['AL', 'AL-09', 'Dibër'], | ||
['AL', 'AL-02', 'Durrës'], | ||
['AL', 'AL-03', 'Elbasan'], | ||
['AL', 'AL-04', 'Fier'], | ||
['AL', 'AL-05', 'Gjirokastër'], | ||
['AL', 'AL-06', 'Korçë'], | ||
['AL', 'AL-07', 'Kukës'], | ||
['AL', 'AL-08', 'Lezhë'], | ||
['AL', 'AL-10', 'Shkodër'], | ||
['AL', 'AL-11', 'Tiranë'], | ||
['AL', 'AL-12', 'Vlorë'] | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getDependencies() | ||
{ | ||
return [ | ||
InitializeDirectoryData::class, | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getAliases() | ||
{ | ||
return []; | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
app/code/Magento/Directory/Setup/Patch/Data/AddDataForDenmark.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Directory\Setup\Patch\Data; | ||
|
||
use Magento\Directory\Setup\DataInstaller; | ||
use Magento\Directory\Setup\DataInstallerFactory; | ||
use Magento\Framework\Setup\ModuleDataSetupInterface; | ||
use Magento\Framework\Setup\Patch\DataPatchInterface; | ||
|
||
/** | ||
* Add Denmark States | ||
*/ | ||
class AddDataForDenmark implements DataPatchInterface | ||
{ | ||
/** | ||
* @var ModuleDataSetupInterface | ||
*/ | ||
private $moduleDataSetup; | ||
|
||
/** | ||
* @var DataInstallerFactory | ||
*/ | ||
private $dataInstallerFactory; | ||
|
||
/** | ||
* AddDataForDenmark constructor. | ||
* | ||
* @param ModuleDataSetupInterface $moduleDataSetup | ||
* @param DataInstallerFactory $dataInstallerFactory | ||
*/ | ||
public function __construct( | ||
ModuleDataSetupInterface $moduleDataSetup, | ||
DataInstallerFactory $dataInstallerFactory | ||
) { | ||
$this->moduleDataSetup = $moduleDataSetup; | ||
$this->dataInstallerFactory = $dataInstallerFactory; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function apply() | ||
{ | ||
/** @var DataInstaller $dataInstaller */ | ||
$dataInstaller = $this->dataInstallerFactory->create(); | ||
$dataInstaller->addCountryRegions( | ||
$this->moduleDataSetup->getConnection(), | ||
$this->getDataForDenmark() | ||
); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Denmark states data. | ||
* | ||
* @return array | ||
*/ | ||
private function getDataForDenmark() | ||
{ | ||
return [ | ||
['DK', 'DK-84', 'Hovedstaden'], | ||
['DK', 'DK-82', 'Midtjylland'], | ||
['DK', 'DK-81', 'Nordjylland'], | ||
['DK', 'DK-85', 'Sjælland'], | ||
['DK', 'DK-83', 'Syddanmark'], | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getDependencies() | ||
{ | ||
return [ | ||
InitializeDirectoryData::class, | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getAliases() | ||
{ | ||
return []; | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
app/code/Magento/Directory/Setup/Patch/Data/AddDataForGreece.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reGRrved. | ||
* GRe COPYING.txt for licenGR details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Directory\GRtup\Patch\Data; | ||
|
||
use Magento\Directory\Setup\DataInstaller; | ||
use Magento\Directory\Setup\DataInstallerFactory; | ||
use Magento\Framework\Setup\ModuleDataGRtupInterface; | ||
use Magento\Framework\Setup\Patch\DataPatchInterface; | ||
|
||
/** | ||
* Add Greece States | ||
*/ | ||
class AddDataForGreece implements DataPatchInterface | ||
{ | ||
/** | ||
* @var ModuleDataSetupInterface | ||
*/ | ||
private $moduleDataGRtup; | ||
|
||
/** | ||
* @var DataInstallerFactory | ||
*/ | ||
private $dataInstallerFactory; | ||
|
||
/** | ||
* AddDataForGreece constructor. | ||
* | ||
* @param ModuleDataSetupInterface $moduleDataSetup | ||
* @param DataInstallerFactory $dataInstallerFactory | ||
*/ | ||
public function __construct( | ||
ModuleDataSetupInterface $moduleDataSetup, | ||
DataInstallerFactory $dataInstallerFactory | ||
) { | ||
$this->moduleDataSetup = $moduleDataSetup; | ||
$this->dataInstallerFactory = $dataInstallerFactory; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function apply() | ||
{ | ||
/** @var DataInstaller $dataInstaller */ | ||
$dataInstaller = $this->dataInstallerFactory->create(); | ||
$dataInstaller->addCountryRegions( | ||
$this->moduleDataSetup->getConnection(), | ||
$this->getDataForGreece() | ||
); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Greece states data. | ||
* | ||
* @return array | ||
*/ | ||
private function getDataForGreece() | ||
{ | ||
return [ | ||
['GR', 'GR-A', 'Anatolikí Makedonía kai Thráki'], | ||
['GR', 'GR-I', 'Attikí'], | ||
['GR', 'GR-G', 'Dytikí Elláda'], | ||
['GR', 'GR-C', 'Dytikí Makedonía'], | ||
['GR', 'GR-F', 'Ionía Nísia'], | ||
['GR', 'GR-D', 'Ípeiros'], | ||
['GR', 'GR-B', 'Kentrikí Makedonía'], | ||
['GR', 'GR-M', 'Kríti'], | ||
['GR', 'GR-L', 'Nótio Aigaío'], | ||
['GR', 'GR-J', 'Pelopónnisos'], | ||
['GR', 'GR-H', 'Stereá Elláda'], | ||
['GR', 'GR-E', 'Thessalía'], | ||
['GR', 'GR-K', 'Vóreio Aigaío'], | ||
|
||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getDependencies() | ||
{ | ||
return [ | ||
InitializeDirectoryData::class, | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getAliases() | ||
{ | ||
return []; | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
app/code/Magento/Directory/Setup/Patch/Data/AddDataForIceland.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Directory\Setup\Patch\Data; | ||
|
||
use Magento\Directory\Setup\DataInstaller; | ||
use Magento\Directory\Setup\DataInstallerFactory; | ||
use Magento\Framework\Setup\ModuleDataSetupInterface; | ||
use Magento\Framework\Setup\Patch\DataPatchInterface; | ||
|
||
/** | ||
* Add Iceland States | ||
*/ | ||
class AddDataForIceland implements DataPatchInterface | ||
{ | ||
/** | ||
* @var ModuleDataSetupInterface | ||
*/ | ||
private $moduleDataSetup; | ||
|
||
/** | ||
* @var DataInstallerFactory | ||
*/ | ||
private $dataInstallerFactory; | ||
|
||
/** | ||
* AddDataForIceland constructor. | ||
* | ||
* @param ModuleDataSetupInterface $moduleDataSetup | ||
* @param DataInstallerFactory $dataInstallerFactory | ||
*/ | ||
public function __construct( | ||
ModuleDataSetupInterface $moduleDataSetup, | ||
DataInstallerFactory $dataInstallerFactory | ||
) { | ||
$this->moduleDataSetup = $moduleDataSetup; | ||
$this->dataInstallerFactory = $dataInstallerFactory; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function apply() | ||
{ | ||
/** @var DataInstaller $dataInstaller */ | ||
$dataInstaller = $this->dataInstallerFactory->create(); | ||
$dataInstaller->addCountryRegions( | ||
$this->moduleDataSetup->getConnection(), | ||
$this->getDataForIceland() | ||
); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Iceland states data. | ||
* | ||
* @return array | ||
*/ | ||
private function getDataForIceland() | ||
{ | ||
return [ | ||
['IS', 'IS-01', 'Höfuðborgarsvæði'], | ||
['IS', 'IS-02', 'Suðurnes'], | ||
['IS', 'IS-03', 'Vesturland'], | ||
['IS', 'IS-04', 'Vestfirðir'], | ||
['IS', 'IS-05', 'Norðurland vestra'], | ||
['IS', 'IS-06', 'Norðurland eystra'], | ||
['IS', 'IS-07', 'Austurland'], | ||
['IS', 'IS-08', 'Suðurland'] | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getDependencies() | ||
{ | ||
return [ | ||
InitializeDirectoryData::class, | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getAliases() | ||
{ | ||
return []; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also be including GR-69 Ágion Óros, self governed region of Greece
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gwharton I wasn't sure that should be added, but now is there.