Skip to content

Commit 50f62cb

Browse files
🔃 [EngCom] Public Pull Requests - 2.1-develop
Accepted Public Pull Requests: - #15146: [Backport] Fix typo in input type variable name (by @dmytro-ch) - #15138: [Backport] Add concrete type hints for product and category resources (by @rogyar)
2 parents 96c3e42 + 4318a1a commit 50f62cb

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

app/code/Magento/Catalog/Model/Category.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
114114
*/
115115
protected $_url;
116116

117+
/**
118+
* @var ResourceModel\Category
119+
*/
120+
protected $_resource;
121+
117122
/**
118123
* URL rewrite model
119124
*
@@ -327,6 +332,16 @@ protected function getCustomAttributesCodes()
327332
return $this->customAttributesCodes;
328333
}
329334

335+
/**
336+
* @throws \Magento\Framework\Exception\LocalizedException
337+
* @return \Magento\Catalog\Model\ResourceModel\Category
338+
* @deprecated because resource models should be used directly
339+
*/
340+
protected function _getResource()
341+
{
342+
return parent::_getResource();
343+
}
344+
330345
/**
331346
* Get flat resource model flag
332347
*

app/code/Magento/Catalog/Model/Product.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
117117
*/
118118
protected $_urlModel = null;
119119

120+
/**
121+
* @var ResourceModel\Product
122+
*/
123+
protected $_resource;
124+
120125
/**
121126
* @var string
122127
*/
@@ -469,6 +474,18 @@ protected function _construct()
469474
$this->_init('Magento\Catalog\Model\ResourceModel\Product');
470475
}
471476

477+
/**
478+
* Get resource instance
479+
*
480+
* @throws \Magento\Framework\Exception\LocalizedException
481+
* @return \Magento\Catalog\Model\ResourceModel\Product
482+
* @deprecated because resource models should be used directly
483+
*/
484+
protected function _getResource()
485+
{
486+
return parent::_getResource();
487+
}
488+
472489
/**
473490
* {@inheritdoc}
474491
*/

app/code/Magento/CatalogSearch/Block/Advanced/Form.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,16 @@ public function getCurrency($attribute)
197197
public function getAttributeInputType($attribute)
198198
{
199199
$dataType = $attribute->getBackend()->getType();
200-
$imputType = $attribute->getFrontend()->getInputType();
201-
if ($imputType == 'select' || $imputType == 'multiselect') {
200+
$inputType = $attribute->getFrontend()->getInputType();
201+
if ($inputType == 'select' || $inputType == 'multiselect') {
202202
return 'select';
203203
}
204204

205-
if ($imputType == 'boolean') {
205+
if ($inputType == 'boolean') {
206206
return 'yesno';
207207
}
208208

209-
if ($imputType == 'price') {
209+
if ($inputType == 'price') {
210210
return 'price';
211211
}
212212

0 commit comments

Comments
 (0)