Skip to content

Commit

Permalink
Removed useless sprintf, which resulted in removing additional code n…
Browse files Browse the repository at this point in the history
…o longer used
  • Loading branch information
df2k2 committed Feb 9, 2019
1 parent 00fb2aa commit 3c98751
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions app/code/Magento/Downloadable/Model/ResourceModel/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
*/
namespace Magento\Downloadable\Model\ResourceModel;

use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\EntityManager\MetadataPool;

/**
* Downloadable Product Samples resource model
*
Expand All @@ -17,11 +13,6 @@
*/
class Link extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
/**
* @var MetadataPool
*/
private $metadataPool;

/**
* Catalog data
*
Expand Down Expand Up @@ -210,10 +201,7 @@ public function getSearchableData($productId, $storeId)
[]
)->join(
['cpe' => $this->getTable('catalog_product_entity')],
sprintf(
'cpe.entity_id = m.product_id',
$this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField()
),
'cpe.entity_id = m.product_id',
[]
)->joinLeft(
['st' => $this->getTable('downloadable_link_title')],
Expand All @@ -234,16 +222,4 @@ protected function _createCurrency()
{
return $this->_currencyFactory->create();
}

/**
* Get MetadataPool instance
* @return MetadataPool
*/
private function getMetadataPool()
{
if (!$this->metadataPool) {
$this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class);
}
return $this->metadataPool;
}
}

0 comments on commit 3c98751

Please sign in to comment.