mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1165: [ Proposal] entityMethod#find() for Entity with ForeignKey as PrimaryKey, pass entity object instead of id #1462
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 (May 21, 2011).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user benoit:
Hi all, i am currently using Doctrine 2.1Beta because i have an entity with foreignKey as primaryKey:
class IndividualsStatus
{
/****
* @var Individuals
*
* @Id
* @ManyToOne(targetEntity="Individuals", inversedBy="diagnosers", cascade={"persist","refresh"})
* @JoinColumns({
* @JoinColumn(name="individuals_id", referencedColumnName="id")
* })
*/
private $individuals;
}
i use the em find method to get an IndividualsStatus entity, i am expecting to do:
$individuals = $em->find('Individuals', 10);
$diagnosers = $em->find('Diagnosers', 15);
$individualsStatus = $em->find('IndividualsStatus', array('individiduals' => $individuals, 'diagnosers' => $diagnosers));
But i have to do:
$individualsStatus = $em->find('IndividualsStatus', array('individiduals' => $individuals->getId(), 'diagnosers' => $diagnosers->getId()));
It's very trivial but maybe another people was expecting that too.
Cheers
@doctrinebot commented on GitHub (Aug 14, 2011):
Comment created by @guilhermeblanco:
This issue is fixed in latest 2.2-DEV by this commit:
63a2f02f4dCheers,
@doctrinebot commented on GitHub (Aug 14, 2011):
Issue was closed with resolution "Fixed"