Skip to content

Commit 42f77b7

Browse files
committed
minor #14088 Update example to match actual make::entity output (vilius-g)
This PR was merged into the 4.4 branch. Discussion ---------- Update example to match actual make::entity output Current example entity class does not match what would be produced by running `php bin/console make:entity`. Commits ------- f453588 Update example to match actual make::entity output
2 parents dc961a6 + f453588 commit 42f77b7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doctrine.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,17 @@ Woh! You now have a new ``src/Entity/Product.php`` file::
131131
// src/Entity/Product.php
132132
namespace App\Entity;
133133

134+
use App\Repository\ProductRepository;
134135
use Doctrine\ORM\Mapping as ORM;
135136

136137
/**
137-
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
138+
* @ORM\Entity(repositoryClass=ProductRepository::class)
138139
*/
139140
class Product
140141
{
141142
/**
142-
* @ORM\Id
143-
* @ORM\GeneratedValue
143+
* @ORM\Id()
144+
* @ORM\GeneratedValue()
144145
* @ORM\Column(type="integer")
145146
*/
146147
private $id;
@@ -155,7 +156,7 @@ Woh! You now have a new ``src/Entity/Product.php`` file::
155156
*/
156157
private $price;
157158

158-
public function getId()
159+
public function getId(): ?int
159160
{
160161
return $this->id;
161162
}

0 commit comments

Comments
 (0)