开发者

Symfony 2 - Doctrine : OnetoOne relationship unclear

i've been losing my nerves over it and spent a couple of hours searching here and there, unfortunately to no avail.

I've got 2 entities, we'll ca开发者_运维百科ll them A and B for the sake of simplicity

<?php

namespace System\Main\SystemBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

class A
{
    /**
    * @ORM\OneToOne(targetEntity="B")
    * @ORM\JoinColumn(name="operator_I_id", referencedColumnName="_I_id")
    */
    private $operator = null;


class B
{
    private $_I_id = null;

I'd like to know how I could possibly get the related entity of A (i.e, B). Here I am with my instance of class A, not knowing how to fetch the related entity (of class B)...I'm stuck here and, to say the least, a bit confused.

Thanks a lot for helping,

S.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜