Skip to content

Commit bda7a95

Browse files
authored
ENGCOM-4210: Removed useless sprintf and removed code no longer needed #21093
2 parents b54071c + 5d361bb commit bda7a95

File tree

1 file changed

+3
-25
lines changed
  • app/code/Magento/Downloadable/Model/ResourceModel

1 file changed

+3
-25
lines changed

app/code/Magento/Downloadable/Model/ResourceModel/Link.php

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
*/
66
namespace Magento\Downloadable\Model\ResourceModel;
77

8-
use Magento\Catalog\Api\Data\ProductInterface;
9-
use Magento\Framework\App\ObjectManager;
10-
use Magento\Framework\EntityManager\MetadataPool;
11-
128
/**
139
* Downloadable Product Samples resource model
1410
*
@@ -17,11 +13,6 @@
1713
*/
1814
class Link extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1915
{
20-
/**
21-
* @var MetadataPool
22-
*/
23-
private $metadataPool;
24-
2516
/**
2617
* Catalog data
2718
*
@@ -210,10 +201,7 @@ public function getSearchableData($productId, $storeId)
210201
[]
211202
)->join(
212203
['cpe' => $this->getTable('catalog_product_entity')],
213-
sprintf(
214-
'cpe.entity_id = m.product_id',
215-
$this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField()
216-
),
204+
'cpe.entity_id = m.product_id',
217205
[]
218206
)->joinLeft(
219207
['st' => $this->getTable('downloadable_link_title')],
@@ -228,22 +216,12 @@ public function getSearchableData($productId, $storeId)
228216
}
229217

230218
/**
219+
* Get Currency model.
220+
*
231221
* @return \Magento\Directory\Model\Currency
232222
*/
233223
protected function _createCurrency()
234224
{
235225
return $this->_currencyFactory->create();
236226
}
237-
238-
/**
239-
* Get MetadataPool instance
240-
* @return MetadataPool
241-
*/
242-
private function getMetadataPool()
243-
{
244-
if (!$this->metadataPool) {
245-
$this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class);
246-
}
247-
return $this->metadataPool;
248-
}
249227
}

0 commit comments

Comments
 (0)