Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Show the advice only when relevant. #369

Merged
merged 2 commits into from

3 participants

@greg0ire

This is indeed a good advice, but people who
already have implemented __toString() might
get confused about it.

@greg0ire greg0ire Show the advice only when necessary.
This is indeed a good advice, but people who
already have implemented __toString() might
get confused about it.
190e63a
@travisbot

This pull request passes (merged 190e63a into 7b75849).

@travisbot

This pull request passes (merged 111bb52 into 7b75849).

@beberlei beberlei merged commit 0c49524 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 10, 2012
  1. @greg0ire

    Show the advice only when necessary.

    greg0ire authored
    This is indeed a good advice, but people who
    already have implemented __toString() might
    get confused about it.
Commits on Jun 11, 2012
  1. @greg0ire

    delimit ternary

    greg0ire authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/Doctrine/ORM/ORMInvalidArgumentException.php
View
8 lib/Doctrine/ORM/ORMInvalidArgumentException.php
@@ -61,9 +61,11 @@ static public function newEntityFoundThroughRelationship(array $assoc, $entry)
. " 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)
Something went wrong with that request. Please try again.