3 namespace Doctrine\Tests\ORM\Functional\Ticket;
5 require_once __DIR__ . '/../../../TestInit.php';
10 class DDC1300Test extends \Doctrine\Tests\OrmFunctionalTestCase
12 public function setUp()
15 $this->_schemaTool->createSchema(array(
16 $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1300Foo'),
17 $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1300FooLocale'),
21 public function testIssue()
23 $foo = new DDC1300Foo();
24 $foo->_fooReference = "foo";
26 $this->_em->persist($foo);
29 $locale = new DDC1300FooLocale();
31 $locale->_locale = "en";
32 $locale->_title = "blub";
34 $this->_em->persist($locale);
37 $query = $this->_em->createQuery('SELECT f, fl FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1300Foo f JOIN f._fooLocaleRefFoo fl');
38 $result = $query->getResult();
40 $this->assertEquals(1, count($result));
51 * @Column(name="fooID", type="integer", nullable=false)
52 * @GeneratedValue(strategy="AUTO")
55 public $_fooID = null;
58 * @var string fooReference
59 * @Column(name="fooReference", type="string", nullable=true, length=45)
61 public $_fooReference = null;
64 * @OneToMany(targetEntity="DDC1300FooLocale", mappedBy="_foo",
65 * cascade={"persist"})
67 public $_fooLocaleRefFoo = null;
72 * @param array|Zend_Config|null $options
73 * @return Bug_Model_Foo
75 public function __construct($options = null)
77 $this->_fooLocaleRefFoo = new \Doctrine\Common\Collections\ArrayCollection();
85 class DDC1300FooLocale
89 * @ManyToOne(targetEntity="DDC1300Foo")
90 * @JoinColumn(name="fooID", referencedColumnName="fooID")
97 * @Column(name="locale", type="string", nullable=false, length=5)
100 public $_locale = null;
104 * @Column(name="title", type="string", nullable=true, length=150)
106 public $_title = null;