Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctrinebot/629547d7a4476b7f888c to your computer and use it in GitHub Desktop.
Save doctrinebot/629547d7a4476b7f888c to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1515 - https://github.com/doctrine/doctrine2/issues/2146
<?php
/**
* @Entity
* @Table(name="test")
*/
class App_Model_Test
{
/**
* @Id
* @ManyToOne(targetEntity="App_Model_Test1")
* @JoinColumn(name="test1_id", referencedColumnName="id", nullable=false)
*/
private $test1;
/**
* @Id
* @ManyToOne(targetEntity="App_Model_Test2")
* @JoinColumn(name="test2_id", referencedColumnName="id", nullable=false)
*/
private $test2;
// /** @Column(name="x", type="integer") */
// private $x;
}
<?php
/**
* @Entity
* @Table(name="test1")
*/
class App_Model_Test1
{
/**
* @Id
* @GeneratedValue(strategy="AUTO")
* @Column(type="smallint")
*/
private $id;
}
<?php
/**
* @Entity
* @Table(name="test2")
*/
class App_Model_Test2
{
/**
* @Id
* @GeneratedValue(strategy="AUTO")
* @Column(type="smallint")
*/
private $id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment