@@ -1206,14 +1206,14 @@ to the given ``Category`` object via their ``category_id`` value.
1206
1206
1207
1207
The proxy classes are generated by Doctrine and stored in the cache directory.
1208
1208
And though you'll probably never even notice that your ``$category ``
1209
- object is actually a proxy object, it's important to keep in mind.
1209
+ object is actually a proxy object, it's important to keep it in mind.
1210
1210
1211
1211
In the next section, when you retrieve the product and category data
1212
1212
all at once (via a *join *), Doctrine will return the *true * ``Category ``
1213
1213
object, since nothing needs to be lazily loaded.
1214
1214
1215
- Joining to Related Records
1216
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
1215
+ Joining Related Records
1216
+ ~~~~~~~~~~~~~~~~~~~~~~~
1217
1217
1218
1218
In the above examples, two queries were made - one for the original object
1219
1219
(e.g. a ``Category ``) and one for the related object(s) (e.g. the ``Product ``
@@ -1305,7 +1305,7 @@ callbacks. This is not necessary if you're using YAML or XML for your mapping:
1305
1305
}
1306
1306
1307
1307
Now, you can tell Doctrine to execute a method on any of the available lifecycle
1308
- events. For example, suppose you want to set a ``created `` date column to
1308
+ events. For example, suppose you want to set a ``createdAt `` date column to
1309
1309
the current date, only when the entity is first persisted (i.e. inserted):
1310
1310
1311
1311
.. configuration-block ::
@@ -1315,9 +1315,9 @@ the current date, only when the entity is first persisted (i.e. inserted):
1315
1315
/**
1316
1316
* @ORM\PrePersist
1317
1317
*/
1318
- public function setCreatedValue ()
1318
+ public function setCreatedAtValue ()
1319
1319
{
1320
- $this->created = new \DateTime();
1320
+ $this->createdAt = new \DateTime();
1321
1321
}
1322
1322
1323
1323
.. code-block :: yaml
@@ -1327,7 +1327,7 @@ the current date, only when the entity is first persisted (i.e. inserted):
1327
1327
type : entity
1328
1328
# ...
1329
1329
lifecycleCallbacks :
1330
- prePersist : [setCreatedValue ]
1330
+ prePersist : [setCreatedAtValue ]
1331
1331
1332
1332
.. code-block :: xml
1333
1333
@@ -1340,18 +1340,18 @@ the current date, only when the entity is first persisted (i.e. inserted):
1340
1340
<!-- ... -->
1341
1341
<lifecycle-callbacks >
1342
1342
<lifecycle-callback type =" prePersist"
1343
- method =" setCreatedValue " />
1343
+ method =" setCreatedAtValue " />
1344
1344
</lifecycle-callbacks >
1345
1345
</entity >
1346
1346
</doctrine-mapping >
1347
1347
1348
1348
.. note ::
1349
1349
1350
- The above example assumes that you've created and mapped a ``created ``
1350
+ The above example assumes that you've created and mapped a ``createdAt ``
1351
1351
property (not shown here).
1352
1352
1353
1353
Now, right before the entity is first persisted, Doctrine will automatically
1354
- call this method and the ``created `` field will be set to the current date.
1354
+ call this method and the ``createdAt `` field will be set to the current date.
1355
1355
1356
1356
This can be repeated for any of the other lifecycle events, which include:
1357
1357
0 commit comments