Skip to content

9677 price is an integer #9680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ and save it!

$product = new Product();
$product->setName('Keyboard');
$product->setPrice(19.99);
$product->setPrice(1999);
$product->setDescription('Ergonomic and stylish!');

// tell Doctrine you want to (eventually) save the Product (no queries yet)
Expand Down Expand Up @@ -441,7 +441,7 @@ Once you have a repository object, you have many helper methods::
// or find by name and price
$product = $repository->findOneBy([
'name' => 'Keyboard',
'price' => 19.99,
'price' => 1999,
]);

// look for multiple Product objects matching the name, ordered by price
Expand Down Expand Up @@ -624,7 +624,7 @@ This uses Doctrine's `Query Builder`_: a very powerful and user-friendly way to
write custom queries. Now, you can call this method on the repository::

// from inside a controller
$minPrice = 10;
$minPrice = 1000;

$products = $this->getDoctrine()
->getRepository(Product::class)
Expand Down Expand Up @@ -654,7 +654,7 @@ In addition to the query builder, you can also query with `Doctrine Query Langua
FROM App\Entity\Product p
WHERE p.price > :price
ORDER BY p.price ASC'
)->setParameter('price', 10);
)->setParameter('price', 1000);

// returns an array of Product objects
return $query->execute();
Expand All @@ -675,7 +675,7 @@ Or directly with SQL if you need to::
ORDER BY p.price ASC
';
$stmt = $conn->prepare($sql);
$stmt->execute(['price' => 10]);
$stmt->execute(['price' => 1000]);

// returns an array of arrays (i.e. a raw data set)
return $stmt->fetchAll();
Expand Down
2 changes: 1 addition & 1 deletion quick_tour/flex_recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ rich API for a ``product`` table? Create a ``Product`` entity and give it the
private $name;

/**
* @ORM\Column(type="string")
* @ORM\Column(type="int")
*/
private $price;

Expand Down