symfony - (Doctrine2-Symfony2) Return foreign keys with findAll() -


मैं एक ऑब्जेक्ट को निम्नलिखित कोड से लौटा रहा हूँ:

  $ myVariable = $ this- & gt; getDoctrine () - & gt; getRepository ( 'MainBundle: TheEntity') - & gt; findAll ();  

मेरा प्रश्न होगा: क्या इसी तरह के फ़ंक्शन के साथ विदेशी कुंजी भी वापस करने का कोई तरीका है?

धन्यवाद।

< P>

डिफ़ॉल्ट रूप से जब आप इसे कॉल करते हैं तो सिद्धांत एक संबद्ध इकाई को लाएगा ताकि आप कुछ जैसे $ myAssociatedEntity = $ myEntities- & gt; getMyAssociatedEntity () । इसे आलसी लोड हो रहा है कहा जाता है और कई छोटे अनुरोधों की ओर ले जाता है, इसलिए यह आम तौर पर जल्दी प्रोटोटाइप के लिए उपयुक्त है। बेहतर अभ्यास एक स्वयं के भंडार विधि को एक संयुक्त खंड के साथ लिखने के लिए होगा ताकि आपको एक बड़ा अनुरोध में सब कुछ मिल जाए।


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -