Skip to content

Commit 5c6585b

Browse files
cordovalweaverryan
authored andcommitted
improvements and typos
1 parent 401e518 commit 5c6585b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

book/doctrine.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -1206,14 +1206,14 @@ to the given ``Category`` object via their ``category_id`` value.
12061206

12071207
The proxy classes are generated by Doctrine and stored in the cache directory.
12081208
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.
12101210

12111211
In the next section, when you retrieve the product and category data
12121212
all at once (via a *join*), Doctrine will return the *true* ``Category``
12131213
object, since nothing needs to be lazily loaded.
12141214

1215-
Joining to Related Records
1216-
~~~~~~~~~~~~~~~~~~~~~~~~~~
1215+
Joining Related Records
1216+
~~~~~~~~~~~~~~~~~~~~~~~
12171217

12181218
In the above examples, two queries were made - one for the original object
12191219
(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:
13051305
}
13061306
13071307
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
13091309
the current date, only when the entity is first persisted (i.e. inserted):
13101310

13111311
.. configuration-block::
@@ -1315,9 +1315,9 @@ the current date, only when the entity is first persisted (i.e. inserted):
13151315
/**
13161316
* @ORM\PrePersist
13171317
*/
1318-
public function setCreatedValue()
1318+
public function setCreatedAtValue()
13191319
{
1320-
$this->created = new \DateTime();
1320+
$this->createdAt = new \DateTime();
13211321
}
13221322
13231323
.. code-block:: yaml
@@ -1327,7 +1327,7 @@ the current date, only when the entity is first persisted (i.e. inserted):
13271327
type: entity
13281328
# ...
13291329
lifecycleCallbacks:
1330-
prePersist: [setCreatedValue]
1330+
prePersist: [setCreatedAtValue]
13311331
13321332
.. code-block:: xml
13331333
@@ -1340,18 +1340,18 @@ the current date, only when the entity is first persisted (i.e. inserted):
13401340
<!-- ... -->
13411341
<lifecycle-callbacks>
13421342
<lifecycle-callback type="prePersist"
1343-
method="setCreatedValue" />
1343+
method="setCreatedAtValue" />
13441344
</lifecycle-callbacks>
13451345
</entity>
13461346
</doctrine-mapping>
13471347
13481348
.. note::
13491349

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``
13511351
property (not shown here).
13521352

13531353
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.
13551355

13561356
This can be repeated for any of the other lifecycle events, which include:
13571357

0 commit comments

Comments
 (0)