Skip to content

Commit e5e7b5d

Browse files
author
Yu Tang
committed
MAGETWO-33488: Add setters to data object interfaces in Tax module
- Replaced some string literals with constant
1 parent 0219f14 commit e5e7b5d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

app/code/Magento/Tax/Api/Data/TaxRateInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface TaxRateInterface extends \Magento\Framework\Api\ExtensibleDataInterfac
1717
const KEY_REGION_ID = 'tax_region_id';
1818
const KEY_REGION_NAME = 'region_name';
1919
const KEY_POSTCODE = 'tax_postcode';
20+
const KEY_ZIP_IS_RANGE = 'zip_is_range';
2021
const KEY_ZIP_RANGE_FROM = 'zip_from';
2122
const KEY_ZIP_RANGE_TO = 'zip_to';
2223
const KEY_PERCENTAGE_RATE = 'rate';

app/code/Magento/Tax/Model/Calculation/Rate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public function getCode()
372372
*/
373373
public function getZipIsRange()
374374
{
375-
return $this->getData('zip_is_range');
375+
return $this->getData(self::KEY_ZIP_IS_RANGE);
376376
}
377377
/**
378378
* Set country id
@@ -426,7 +426,7 @@ public function setTaxPostcode($taxPostCode)
426426
*/
427427
public function setZipIsRange($zipIsRange)
428428
{
429-
return $this->setData('zip_is_range', $zipIsRange);
429+
return $this->setData(self::KEY_ZIP_IS_RANGE, $zipIsRange);
430430
}
431431

432432
/**

app/code/Magento/Tax/Model/Calculation/Rule.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\Tax\Model\Calculation;
77

8-
use int;
98
use Magento\Framework\Api\AttributeValueFactory;
109
use Magento\Framework\Api\MetadataServiceInterface;
1110
use Magento\Tax\Api\Data\TaxRuleInterface;

app/code/Magento/Tax/Model/ClassModel.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,23 @@ public function beforeDelete()
123123
*/
124124
public function getClassId()
125125
{
126-
return $this->getData('class_id');
126+
return $this->getData(self::KEY_ID);
127127
}
128128

129129
/**
130130
* {@inheritdoc}
131131
*/
132132
public function getClassName()
133133
{
134-
return $this->getData('class_name');
134+
return $this->getData(self::KEY_NAME);
135135
}
136136

137137
/**
138138
* {@inheritdoc}
139139
*/
140140
public function getClassType()
141141
{
142-
return $this->getData('class_type');
142+
return $this->getData(self::KEY_TYPE);
143143
}
144144
/**
145145
* Set tax class ID.
@@ -149,7 +149,7 @@ public function getClassType()
149149
*/
150150
public function setClassId($classId)
151151
{
152-
return $this->setData('class_id', $classId);
152+
return $this->setData(self::KEY_ID, $classId);
153153
}
154154

155155
/**
@@ -160,7 +160,7 @@ public function setClassId($classId)
160160
*/
161161
public function setClassName($className)
162162
{
163-
return $this->setData('class_name', $className);
163+
return $this->setData(self::KEY_NAME, $className);
164164
}
165165

166166
/**
@@ -171,7 +171,7 @@ public function setClassName($className)
171171
*/
172172
public function setClassType($classType)
173173
{
174-
return $this->setData('class_type', $classType);
174+
return $this->setData(self::KEY_TYPE, $classType);
175175
}
176176
//@codeCoverageIgnoreEnd
177177
}

0 commit comments

Comments
 (0)