[FLOW3-general] Join column not created for OneToOne relationship
Jackie Stallard
jstallard at internode.on.net
Tue Jan 3 06:18:10 CET 2012
Thank you thank you thank you Sebastian!
I've been fiddling with that for hours!
I guess I shouldn't take the Doctrine manual so literally!
The Scope lines are generated by flow3's model kickstarter but I've
taken them out as you suggested.
:)
Jackie
On 03/01/12 15:58, Sebastian Kurfürst wrote:
> Hey Jackie,
>
> Am 03.01.12 05:44, schrieb Jackie Stallard:
>> Hi
>>
>> I'm new to Flow3 and am having difficulty creating a OneToOne
>> unidirectional mapping. Doctrine updates with no errors but does not
>> create a join column in my table.
>>
>> /**
>> * @FLOW3\Scope("prototype")
> can be removed, as prototype scope is the default.
>> * @FLOW3\Entity
>> */
>> class CommunicationsDeviceTest {
>>
>> /**
>> * @ORM\OneToOne(targetEntity="CommunicationsTypeTest")
>> * @ORM\JoinColumn(name="communicationsType_id",
>> referencedColumnName="id")
> The above two annotations should be:
> @var \Your\Full\Namespace\To\CommunicationsTypeTest
> @ORM\OneToOne
>> */
>> protected $communicationsType;
>> etc.
>> }
>>
>> /**
>> * @FLOW3\Scope("prototype")
> Prototype annotation can be removed, see above.
>> * @FLOW3\Entity
>> */
>> class CommunicationsTypeTest {
>>
>> /**
>> * The id
>> * @var integer
>> * @ORM\Id
>> * @ORM\GeneratedValue
>> */
>> protected $id;
> You should completely remove the above stuff; FLOW3 automatically
> handles the identity of an object for you.
>
> Greets,
> Sebastian
More information about the FLOW3-general
mailing list