Skip to content

Commit 08bf60c

Browse files
committed
Tweaking language for doctrine:generate:entities - see symfony#1020
1 parent 41d1356 commit 08bf60c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

book/doctrine.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,24 +283,28 @@ for the ``Product`` class. This is a safe command - you can run it over and
283283
over again: it only generates getters and setters that don't exist (i.e. it
284284
doesn't replace your existing methods).
285285

286-
.. note::
287-
288-
Using ``doctrine:generate:entities`` command you can:
286+
.. sidebar:: More about ``doctrine:generate:entities``
289287

290-
* generate getters and setters,
288+
With the ``doctrine:generate:entities`` command you can:
291289

292-
* generate repository classes configured with
293-
``@ORM\Entity(repositoryClass="...")`` annotation,
290+
* generate getters and setters,
294291

295-
* generate appropriate constructor for 1:n and n:m relations.
292+
* generate repository classes configured with the
293+
``@ORM\Entity(repositoryClass="...")`` annotation,
296294

297-
.. caution::
295+
* generate the appropriate constructor for 1:n and n:m relations.
298296

299297
The ``doctrine:generate:entities`` command saves a backup of the original
300298
``Product.php`` named ``Product.php~``. In some cases, the presence of
301299
this file can cause a "Cannot redeclare class" error. It can be safely
302300
removed.
303301

302+
Note that you don't *need* to use this command. Doctrine doesn't rely
303+
on code generation. Like with normal PHP classes, you just need to make
304+
sure that your protected/private properties have getter and setter methods.
305+
Since this is a common thing to do when using Doctrine, this command
306+
was created.
307+
304308
You can also generate all known entities (i.e. any PHP class with Doctrine
305309
mapping information) of a bundle or an entire namespace:
306310

0 commit comments

Comments
 (0)