Skip to content

Commit fc96d23

Browse files
authored
Update simple-repository.md
1 parent 9ed34e0 commit fc96d23

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/simple-repository.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $db->getAliasRegistry()->add('shop', 'shop__');
88
```
99

1010
```PHP
11-
class ProductAmountQuery {
11+
class ProductPriceQuery {
1212
/** @var Database */
1313
private $db;
1414

@@ -43,16 +43,16 @@ class ProductAmountQuery {
4343
class ProductRepository {
4444
/** @var Database */
4545
private $db;
46-
/** @var ProductAmountQuery */
47-
private $amountQuery;
46+
/** @var ProductPriceQuery */
47+
private $priceQuery;
4848

4949
/**
5050
* @param Database $db
51-
* @param ProductAmountQuery $amountQuery
51+
* @param ProductPriceQuery $priceQuery
5252
*/
53-
public function __construct(Database $db, ProductAmountQuery $amountQuery) {
53+
public function __construct(Database $db, ProductAmountQuery $priceQuery) {
5454
$this->db = $db;
55-
$this->amountQuery = $amountQuery;
55+
$this->priceQuery = $priceQuery;
5656
}
5757

5858
/**
@@ -70,7 +70,7 @@ class ProductRepository {
7070
->field('spl.description')
7171
->from('sp', 'shop#products')
7272
->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')
7474
->where('sp.active=?', true)
7575
->where($req('spl.lang_id=?', 'language.id'))
7676
->where($opt('sp.reference=?', 'product.reference'))
@@ -107,7 +107,7 @@ class ProductRepository {
107107
```
108108

109109
```PHP
110-
$pr = new ProductRepository($db, new ProductAmountQuery($db));
110+
$pr = new ProductRepository($db, new ProductPriceQuery($db));
111111
$pr->find([
112112
'language' => [
113113
'id' => 'en',

0 commit comments

Comments
 (0)