1
0
Fork 0
mirror of synced 2025-04-01 12:26:11 +03:00

Show the advice only when necessary.

This is indeed a good advice, but people who
already have implemented __toString() might
get confused about it.
This commit is contained in:
Grégoire Paris 2012-06-10 23:59:07 +03:00
parent 7b758493a3
commit 190e63a6bb

View file

@ -61,9 +61,11 @@ class ORMInvalidArgumentException extends \InvalidArgumentException
. " configured to cascade persist operations for entity: " . self::objToStr($entry) . "."
. " To solve this issue: Either explicitly call EntityManager#persist()"
. " on this unknown entity or configure cascade persist "
. " this association in the mapping for example @ManyToOne(..,cascade={\"persist\"}). "
. " If you cannot find out which entity causes the problem"
. " implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue.");
. " this association in the mapping for example @ManyToOne(..,cascade={\"persist\"})."
. method_exists($entry, '__toString') ?
"":
" If you cannot find out which entity causes the problem"
." implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue.");
}
static public function detachedEntityFoundThroughRelationship(array $assoc, $entry)