mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2080: Entity's association changes after first call #2624
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Oct 15, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user iamkoby:
i am using the latest version of doctrine: 2.3
when you call a generated association function, the first time everything is fine:
$authors = $book->getBookToAuthors();
//$authors = array(5)
but the second time instead of returning the array of all associations it returns the last hydrated entity:
$authors = $book->getBookToAuthors();
//$authors = BookToAuthor entity
that happens even when there is nothing else happening:
$authors = $book->getBookToAuthors(); //will work
$authors = $book->getBookToAuthors(); //won't work
the function of getBookToAuthors() is:
public function getBookToAuthors()
{
return $this->bookToAuthors;
}
and the mapping is as follows:
/****
*
*/
private $bookToAuthors;
please advise. i don't know what to do... :-(
@doctrinebot commented on GitHub (Oct 15, 2012):
Comment created by iamkoby:
sorry sorry sorry
it was a mistake in the association target side.
the target had One-To-One association instead of Many-To-One
@doctrinebot commented on GitHub (Oct 15, 2012):
Issue was closed with resolution "Invalid"