@@ -335,7 +335,7 @@ and save it!
335
335
336
336
$product = new Product();
337
337
$product->setName('Keyboard');
338
- $product->setPrice(19.99 );
338
+ $product->setPrice(1999 );
339
339
$product->setDescription('Ergonomic and stylish!');
340
340
341
341
// tell Doctrine you want to (eventually) save the Product (no queries yet)
@@ -441,7 +441,7 @@ Once you have a repository object, you have many helper methods::
441
441
// or find by name and price
442
442
$product = $repository->findOneBy([
443
443
'name' => 'Keyboard',
444
- 'price' => 19.99 ,
444
+ 'price' => 1999 ,
445
445
]);
446
446
447
447
// look for multiple Product objects matching the name, ordered by price
@@ -624,7 +624,7 @@ This uses Doctrine's `Query Builder`_: a very powerful and user-friendly way to
624
624
write custom queries. Now, you can call this method on the repository::
625
625
626
626
// from inside a controller
627
- $minPrice = 10 ;
627
+ $minPrice = 1000 ;
628
628
629
629
$products = $this->getDoctrine()
630
630
->getRepository(Product::class)
@@ -654,7 +654,7 @@ In addition to the query builder, you can also query with `Doctrine Query Langua
654
654
FROM App\Entity\Product p
655
655
WHERE p.price > :price
656
656
ORDER BY p.price ASC'
657
- )->setParameter('price', 10 );
657
+ )->setParameter('price', 1000 );
658
658
659
659
// returns an array of Product objects
660
660
return $query->execute();
@@ -675,7 +675,7 @@ Or directly with SQL if you need to::
675
675
ORDER BY p.price ASC
676
676
';
677
677
$stmt = $conn->prepare($sql);
678
- $stmt->execute(['price' => 10 ]);
678
+ $stmt->execute(['price' => 1000 ]);
679
679
680
680
// returns an array of arrays (i.e. a raw data set)
681
681
return $stmt->fetchAll();
0 commit comments