@@ -283,24 +283,28 @@ for the ``Product`` class. This is a safe command - you can run it over and
283
283
over again: it only generates getters and setters that don't exist (i.e. it
284
284
doesn't replace your existing methods).
285
285
286
- .. note ::
287
-
288
- Using ``doctrine:generate:entities `` command you can:
286
+ .. sidebar :: More about ``doctrine:generate:entities``
289
287
290
- * generate getters and setters,
288
+ With the `` doctrine: generate:entities `` command you can:
291
289
292
- * generate repository classes configured with
293
- ``@ORM\Entity(repositoryClass="...") `` annotation,
290
+ * generate getters and setters,
294
291
295
- * generate appropriate constructor for 1:n and n: m relations.
292
+ * generate repository classes configured with the
293
+ ``@ORM\Entity(repositoryClass="...") `` annotation,
296
294
297
- .. caution ::
295
+ * generate the appropriate constructor for 1 :n and n: m relations.
298
296
299
297
The ``doctrine:generate:entities `` command saves a backup of the original
300
298
``Product.php `` named ``Product.php~ ``. In some cases, the presence of
301
299
this file can cause a "Cannot redeclare class" error. It can be safely
302
300
removed.
303
301
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
+
304
308
You can also generate all known entities (i.e. any PHP class with Doctrine
305
309
mapping information) of a bundle or an entire namespace:
306
310
0 commit comments