Skip to content

Commit

Permalink
ENGCOM-4210: Removed useless sprintf and removed code no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
sidolov authored Feb 13, 2019
2 parents b54071c + 5d361bb commit bda7a95
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 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 @@ -228,22 +216,12 @@ public function getSearchableData($productId, $storeId)
}

/**
* Get Currency model.
*
* @return \Magento\Directory\Model\Currency
*/
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 bda7a95

Please sign in to comment.