Skip to content

Commit

Permalink
[cookbook][upload] Adding a warning message about the Doctrine update…
Browse files Browse the repository at this point in the history
… events not being fired. We will need a more instructive solution.
  • Loading branch information
weaverryan committed Jul 30, 2011
1 parent 81f3af8 commit 808da21
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cookbook/doctrine/file_uploads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,15 @@ entity is ever deleted.
other hand, the ``@ORM\PreUpdate()`` and ``@ORM\PostUpdate()`` event
callbacks are called when the entity is updated.

.. caution::

The ``PreUpdate`` and ``PostUpdate`` callbacks are only triggered if there
is a change in one of the entity's field that are persisted. This means
that, by default, if you modify only the ``$file`` property, these events
will not be triggered, as the property itself is not directly persisted
via Doctrine. One solution would be to use an ``updated`` field that's
persisted to Doctrine, and to modify it manually when changing the file.

Using the ``id`` as the filename
--------------------------------

Expand Down

0 comments on commit 808da21

Please sign in to comment.