getting deeper into doctrine. But actually I get stucked with this.
Got this to persist:
$f = new Field();
$f->setValue(123);
$em = $this->getEntityManager();
$em->persist($f);
$em->flush();
In my Entity called Field I will relate to an Entity called Integer
/**
* @ORM\OneToOne(targetEntity="Integer", mappedBy="field", cascade="persist")
**/
private $integer;
In my Entity Integer I need to relate to Field like this
/**
* @ORM\OneToOne(targetEntity="Field", inversedBy="integer")
* @ORM\JoinColumn(name="fid", referencedColumnName="id")
**/
private $field;
it works, but how can I read the integer? I can see the field ID in the integer table for the new entry. But shouldn't be there a column in Fields pointing to integers?
I tried to set a column for relating to integers in fields entity like this:
* @ORM\JoinColumn(name="int", referencedColumnName="id")
But it did not work
cu n00n