5
5
*/
6
6
namespace Magento \Downloadable \Model \ResourceModel ;
7
7
8
- use Magento \Catalog \Api \Data \ProductInterface ;
9
- use Magento \Framework \App \ObjectManager ;
10
- use Magento \Framework \EntityManager \MetadataPool ;
11
-
12
8
/**
13
9
* Downloadable Product Samples resource model
14
10
*
17
13
*/
18
14
class Link extends \Magento \Framework \Model \ResourceModel \Db \AbstractDb
19
15
{
20
- /**
21
- * @var MetadataPool
22
- */
23
- private $ metadataPool ;
24
-
25
16
/**
26
17
* Catalog data
27
18
*
@@ -210,10 +201,7 @@ public function getSearchableData($productId, $storeId)
210
201
[]
211
202
)->join (
212
203
['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 ' ,
217
205
[]
218
206
)->joinLeft (
219
207
['st ' => $ this ->getTable ('downloadable_link_title ' )],
@@ -228,22 +216,12 @@ public function getSearchableData($productId, $storeId)
228
216
}
229
217
230
218
/**
219
+ * Get Currency model.
220
+ *
231
221
* @return \Magento\Directory\Model\Currency
232
222
*/
233
223
protected function _createCurrency ()
234
224
{
235
225
return $ this ->_currencyFactory ->create ();
236
226
}
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
- }
249
227
}
0 commit comments