I think this has what you need
http://www.symfony-project.org/cookbook/1_2/en/retrieving_data_with_doctrine
Basically you should be able to add:
->leftJoin('d.Name Dep')
after your current leftJoin and then you should be able to reference it by
$contact->Dept.
Again, I haven't messed with it much so it may be a bit different, but that
should prevent many database queries and get it all at the same time.
Robert LeBlanc
Life Sciences & Undergraduate Education Computer Support
Brigham Young University
On Thu, Jul 30, 2009 at 5:56 PM, AJ ONeal <[email protected]> wrote:
> I'm getting hung up on something really simple (or so I would think).
>
> I have a class Contact which has department_id.
> In ContactTable I use ->leftJoin('c.Department d')
> because I want iterate through $contact_list
> and access $contact->Department()->name()
> rather than Doctrine::getTable('Department')->createQuery.... where('id =
> ?', $contact->getDepartmentName())
>
> However, I can't figure out how to create something like
> $contact->Department()
> and the other method would generate hundreds of excess database calls
>
> AJ ONeal
>
>
> On Thu, Jul 30, 2009 at 5:32 PM, Robert LeBlanc <[email protected]>wrote:
>
>> We are starting to use it here in Life Sciences. I haven't worked with it
>> much, but one of my students has done quite a bit with it. What questions do
>> you have and I can pass on the ones that I can't answer.
>>
>> Robert LeBlanc
>> Life Sciences & Undergraduate Education Computer Support
>> Brigham Young University
>>
>>
>> On Thu, Jul 30, 2009 at 4:56 PM, AJ ONeal <[email protected]> wrote:
>>
>>> Are any of you familiar with PHP Symfony?
>>>
>>> I have some newbie questions that I'm not finding the answers to.
>>>
>>>
>>> AJ ONeal
>>>
>>> --------------------
>>> BYU Unix Users Group
>>> http://uug.byu.edu/
>>>
>>> The opinions expressed in this message are the responsibility of their
>>> author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
>>> ___________________________________________________________________
>>> List Info (unsubscribe here):
>>> http://uug.byu.edu/mailman/listinfo/uug-list
>>>
>>
>>
>> --------------------
>> BYU Unix Users Group
>> http://uug.byu.edu/
>>
>> The opinions expressed in this message are the responsibility of their
>> author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
>> ___________________________________________________________________
>> List Info (unsubscribe here):
>> http://uug.byu.edu/mailman/listinfo/uug-list
>>
>
>
> --------------------
> BYU Unix Users Group
> http://uug.byu.edu/
>
> The opinions expressed in this message are the responsibility of their
> author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
> ___________________________________________________________________
> List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list
>
--------------------
BYU Unix Users Group
http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list