@@ -8,7 +8,7 @@ $db->getAliasRegistry()->add('shop', 'shop__');
8
8
```
9
9
10
10
``` PHP
11
- class ProductAmountQuery {
11
+ class ProductPriceQuery {
12
12
/** @var Database */
13
13
private $db;
14
14
@@ -43,16 +43,16 @@ class ProductAmountQuery {
43
43
class ProductRepository {
44
44
/** @var Database */
45
45
private $db;
46
- /** @var ProductAmountQuery */
47
- private $amountQuery ;
46
+ /** @var ProductPriceQuery */
47
+ private $priceQuery ;
48
48
49
49
/**
50
50
* @param Database $db
51
- * @param ProductAmountQuery $amountQuery
51
+ * @param ProductPriceQuery $priceQuery
52
52
*/
53
- public function __construct(Database $db, ProductAmountQuery $amountQuery ) {
53
+ public function __construct(Database $db, ProductAmountQuery $priceQuery ) {
54
54
$this->db = $db;
55
- $this->amountQuery = $amountQuery ;
55
+ $this->priceQuery = $priceQuery ;
56
56
}
57
57
58
58
/**
@@ -70,7 +70,7 @@ class ProductRepository {
70
70
->field('spl.description')
71
71
->from('sp', 'shop#products')
72
72
->joinInner('spl', 'shop#product_descriptions', 'spl.product_id = sp.id')
73
- ->joinLeft('p', $this->amountQuery ->getAll($criteria), 'sp.product_id = p.product_id')
73
+ ->joinLeft('p', $this->priceQuery ->getAll($criteria), 'sp.product_id = p.product_id')
74
74
->where('sp.active=?', true)
75
75
->where($req('spl.lang_id=?', 'language.id'))
76
76
->where($opt('sp.reference=?', 'product.reference'))
@@ -107,7 +107,7 @@ class ProductRepository {
107
107
```
108
108
109
109
``` PHP
110
- $pr = new ProductRepository($db, new ProductAmountQuery ($db));
110
+ $pr = new ProductRepository($db, new ProductPriceQuery ($db));
111
111
$pr->find([
112
112
'language' => [
113
113
'id' => 'en',
0 commit comments