Domanda

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 .

È stato utile?

Soluzione

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)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top