-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-8244: Add Regions for Uruguay. #29722
- 2.4.8-beta2
- 2.4.8-beta1
- 2.4.7
- 2.4.7-p4
- 2.4.7-p3
- 2.4.7-p2
- 2.4.7-p1
- 2.4.7-beta3
- 2.4.7-beta2
- 2.4.7-beta1
- 2.4.6
- 2.4.6-p9
- 2.4.6-p8
- 2.4.6-p7
- 2.4.6-p6
- 2.4.6-p5
- 2.4.6-p4
- 2.4.6-p3
- 2.4.6-p2
- 2.4.6-p1
- 2.4.5
- 2.4.5-p11
- 2.4.5-p10
- 2.4.5-p9
- 2.4.5-p8
- 2.4.5-p7
- 2.4.5-p6
- 2.4.5-p5
- 2.4.5-p4
- 2.4.5-p3
- 2.4.5-p2
- 2.4.5-p1
- 2.4.4
- 2.4.4-p12
- 2.4.4-p11
- 2.4.4-p10
- 2.4.4-p9
- 2.4.4-p8
- 2.4.4-p7
- 2.4.4-p6
- 2.4.4-p5
- 2.4.4-p4
- 2.4.4-p3
- 2.4.4-p2
- 2.4.4-p1
- 2.4.3
- 2.4.3-p3
- 2.4.3-p2
- 2.4.3-p1
- 2.4.2
- 2.4.2-p2
- 2.4.2-p1
Showing
1 changed file
with
104 additions
and
0 deletions.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
app/code/Magento/Directory/Setup/Patch/Data/AddDataForUruguay.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,104 @@ | ||
<?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 Uruguay States/Regions | ||
*/ | ||
class AddDataForUruguay implements DataPatchInterface | ||
{ | ||
/** | ||
* @var ModuleDataSetupInterface | ||
*/ | ||
private $moduleDataSetup; | ||
|
||
/** | ||
* @var DataInstallerFactory | ||
*/ | ||
private $dataInstallerFactory; | ||
|
||
/** | ||
* @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->getDataForUruguay() | ||
); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Uruguay states data. | ||
* | ||
* @return array | ||
*/ | ||
private function getDataForUruguay(): array | ||
{ | ||
return [ | ||
['UY', 'UY-AR', 'Artigas'], | ||
['UY', 'UY-CA', 'Canelones'], | ||
['UY', 'UY-CL', 'Cerro Largo'], | ||
['UY', 'UY-CO', 'Colonia'], | ||
['UY', 'UY-DU', 'Durazno'], | ||
['UY', 'UY-FS', 'Flores'], | ||
['UY', 'UY-FD', 'Florida'], | ||
['UY', 'UY-LA', 'Lavalleja'], | ||
['UY', 'UY-MA', 'Maldonado'], | ||
['UY', 'UY-MO', 'Montevideo'], | ||
['UY', 'UY-PA', 'Paysandu'], | ||
['UY', 'UY-RN', 'Río Negro'], | ||
['UY', 'UY-RV', 'Rivera'], | ||
['UY', 'UY-RO', 'Rocha'], | ||
['UY', 'UY-SA', 'Salto'], | ||
['UY', 'UY-SJ', 'San José'], | ||
['UY', 'UY-SO', 'Soriano'], | ||
['UY', 'UY-TA', 'Tacuarembó'], | ||
['UY', 'UY-TT', 'Treinta y Tres'] | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function getDependencies() | ||
{ | ||
return [ | ||
InitializeDirectoryData::class, | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getAliases() | ||
{ | ||
return []; | ||
} | ||
} |