[FLOW3-general] Doctrine OneToOne Relation

Thomas Mammitzsch thomas at visualworx.de
Tue Dec 11 15:15:09 CET 2012


Hi list,

i have 2 objects and want to join those two based on an identifier that 
ist not persistence_object_identifier.

class Scoutobject {

     /**
      * The scoutobjectid
      * @var integer
      */
     protected $scoutobjectid;


     /**
      * @var Acme\Demo\Domain\Model\Objectcoordinates
      * @ORM\OneToOne
      * @ORM\JoinColumn(name="scoutobjectid", 
referencedColumnName="scoutobject_scoutobjectid")
      */
     protected $objectcoordinates;
}


class Objectcoordinates {

	/**
	 * The scoutobject_scoutobjectid
	 * @var integer
	 */
	protected $scoutobject_scoutobjectid;

}

When using flow doctrine:update i end up on this error:

An exception occurred while executing 'ALTER TABLE
acme_demo_domain_model_scoutobject ADD CONSTRAINT
FK_4DE578D5405180DF FOREIGN KEY (scoutobjectid) REFERENCES
acme_demo_domain_model_objectcoordinates
(scoutobject_scoutobjectid)':

regards, Thomas


More information about the FLOW3-general mailing list