Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit808da21

Browse files
committed
[cookbook][upload] Adding a warning message about the Doctrine update events not being fired. We will need a more instructive solution.
1 parent81f3af8 commit808da21

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎cookbook/doctrine/file_uploads.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,15 @@ entity is ever deleted.
307307
other hand, the ``@ORM\PreUpdate()`` and ``@ORM\PostUpdate()`` event
308308
callbacks are called when the entity is updated.
309309

310+
..caution::
311+
312+
The ``PreUpdate`` and ``PostUpdate`` callbacks are only triggered if there
313+
is a change in one of the entity's field that are persisted. This means
314+
that, by default, if you modify only the ``$file`` property, these events
315+
will not be triggered, as the property itself is not directly persisted
316+
via Doctrine. One solution would be to use an ``updated`` field that's
317+
persisted to Doctrine, and to modify it manually when changing the file.
318+
310319
Using the ``id`` as the filename
311320
--------------------------------
312321

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp