سؤال

How to use sql joins in zend framwork 2 with Doctrine 2 ?

I want to join to column std_id in student table and user id in user table .

هل كانت مفيدة؟

المحلول

You can find this in the Doctrine documentation:

Doctrine2 : one-to-one unidirectional mapping

I assume in ZF2/Doctrine2 you will have to put "ORM\" before the Doctrine annotations:

/**
 * @ORM\OneToOne(targetEntity="Shipping")
 * @ORM\JoinColumn(name="shipping_id", referencedColumnName="id")
 */

(edit: added zf2 variant of annotation)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top