Skip to content

Commit

Permalink
Registration: new region #370
Browse files Browse the repository at this point in the history
  • Loading branch information
uaoleg committed Mar 25, 2016
1 parent ce0600a commit 002858c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions common/models/Geo/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Region extends \common\ext\MongoDb\Document
* Available regions
*/
const NAME_CENTER = 'center';
const NAME_NORTH = 'north';
const NAME_EAST = 'east';
const NAME_KIEV = 'kiev';
const NAME_SOUTH = 'south';
const NAME_WEST = 'west';
const NAME_SOUTH_WEST = 'south_west';
Expand Down Expand Up @@ -66,8 +66,8 @@ public function attributeLabels()
'name' => \yii::t('app', 'Region name'),
'const.name' => array(
static::NAME_CENTER => \yii::t('app', 'Center'),
static::NAME_NORTH => \yii::t('app', 'North'),
static::NAME_EAST => \yii::t('app', 'East'),
static::NAME_KIEV => \yii::t('app', 'Kiev'),
static::NAME_SOUTH => \yii::t('app', 'South'),
static::NAME_WEST => \yii::t('app', 'West'),
static::NAME_SOUTH_WEST => \yii::t('app', 'Southwestern'),
Expand Down
30 changes: 15 additions & 15 deletions common/models/Geo/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,41 +88,41 @@ public function getRegion()
{
if ($this->_region === null) {
switch ($this->name) {
case static::NAME_CHERNIHIV:
case static::NAME_DNIPROPETROVSK:
case static::NAME_KIROVOHRAD:
case static::NAME_POLTAVA:
case static::NAME_CHERKASY:
$this->_region = Region::get(Region::NAME_CENTER);
break;
case static::NAME_KIEV:
case static::NAME_SUMY:
case static::NAME_VINNYTSIA:
case static::NAME_CHERNIHIV:
case static::NAME_ZHYTOMYR:
$this->_region = Region::get(Region::NAME_CENTER);
$this->_region = Region::get(Region::NAME_NORTH);
break;
case static::NAME_DONETSK:
case static::NAME_KHARKIV:
case static::NAME_LUHANSK:
$this->_region = Region::get(Region::NAME_EAST);
break;
case static::NAME_KIEV:
$this->_region = Region::get(Region::NAME_KIEV);
break;
case static::NAME_ARC:
case static::NAME_KHERSON:
case static::NAME_ZAPORIZHIA:
case static::NAME_MYKOLAIV:
case static::NAME_KHERSON:
case static::NAME_ODESSA:
case static::NAME_ZAPORIZHIA:
$this->_region = Region::get(Region::NAME_SOUTH);
break;
case static::NAME_IVANO_FRANKIVSK:
case static::NAME_VOLYN:
case static::NAME_LVIV:
case static::NAME_RIVNE:
case static::NAME_TERNOPIL:
case static::NAME_ZAKARPATTIA:
case static::NAME_KHMELNYTSKYI:
case static::NAME_CHERNIVTSI:
$this->_region = Region::get(Region::NAME_WEST);
break;
case static::NAME_DNIPROPETROVSK:
case static::NAME_POLTAVA:
case static::NAME_KIROVOHRAD:
case static::NAME_CHERKASY:
case static::NAME_VINNYTSIA:
case static::NAME_KHMELNYTSKYI:
case static::NAME_TERNOPIL:
case static::NAME_CHERNIVTSI:
$this->_region = Region::get(Region::NAME_SOUTH_WEST);
break;
}
Expand Down

0 comments on commit 002858c

Please sign in to comment.