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

Commitf3b07bf

Browse files
Explain what happens ifflush() fails
It should be mentioned *somewhere* in this chapter, how to verify that the entity has really been persisted. What's the best practice here? try...catch? Or (for INSERT) check if $entity->getId() does exist? => Please expand on that.Also, you could list all possible types of exceptions explicitly.
1 parentb7b13f0 commitf3b07bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎doctrine.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ Take a look at the previous example in more detail:
555555
``Product`` objects and then subsequently call ``flush()``, Doctrine will
556556
execute 100 ``INSERT`` queries using a single prepared statement object.
557557

558+
..note::
559+
560+
If ``flush()`` fails, an exception is thrown, which you can catch by wrapping
561+
the ``flush()`` method in a ``try...catch`` block.
562+
558563
Whether creating or updating objects, the workflow is always the same. In
559564
the next section, you'll see how Doctrine is smart enough to automatically
560565
issue an ``UPDATE`` query if the entity already exists in the database.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp