Google Groups Home
Help | Sign in
Message from discussion Bug?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jonathan Wage  
View profile
 More options 14 May, 20:09
From: "Jonathan Wage" <jonw...@gmail.com>
Date: Wed, 14 May 2008 14:09:08 -0500
Local: Wed 14 May 2008 20:09
Subject: Re: [doctrine-user] Re: Bug?

Hmm. Are you sure about that? If you don't specify a select() in 1.0 it will
default to select all columns across all tables.

- Jon

On Wed, May 14, 2008 at 1:24 PM, Alex <outroa...@gmail.com> wrote:
> One more question. When must ->select() be added to a Doctrine_Query
> object? I've noticed that if I select from more than one table Doctrine
> doesn't select columns from the joined tables. If I have ->from('Table t') ,
> it selects t.* . But if I add ->innerJoin('Table2 t2'), it doesn't select
> t2.*.

> Couldn't find anything about it in the manual.

> Thanks for your help Jon!

> - alex

> On Wed, May 14, 2008 at 3:18 PM, Jonathan Wage <jonw...@gmail.com> wrote:

>> It is good practice. You should always use them so that all values are
>> prepared. In this case it doesn't matter as much since the value isn't
>> necessarily user input.

>> - Jon

>> On Wed, May 14, 2008 at 1:15 PM, Alex <outroa...@gmail.com> wrote:

>>>  Bingo! That worked. All DQL commands must be uppercased? What's the
>>> advantage of using the tokens?

>>> On Wed, May 14, 2008 at 3:13 PM, Jonathan Wage <jonw...@gmail.com>
>>> wrote:

>>>> Try capitalized WITH? Also I would use tokens in your query. ? instead
>>>> of directly concatenating it in to the DQL query.

>>>> - Jon

>>>> On Wed, May 14, 2008 at 1:10 PM, Alex <outroa...@gmail.com> wrote:

>>>>>  $query = Doctrine_Query::create()->from('CommentItem
>>>>> c')->leftJoin('c.sfGuardUser u')->leftJoin('c.VoteComment vc with vc.user_id
>>>>> = '.$this->getUser()->getId());
>>>>>     }

>>>>>     $treeObject = $commentTable->getTree();
>>>>>     $treeObject->setBaseQuery($query);

>>>>>     echo $treeObject->getBaseQuery()->getSqlQuery();

>>>>> Output is

>>>>> "SELECT c.id AS c__id, c.lft AS c__lft, c.rgt AS c__rgt, c.level AS
>>>>> c__level, c.root_id AS c__root_id FROM comments c LEFT JOIN sf_guard_user s
>>>>> ON c.user_id = s.id LEFT JOIN votes v ON c.id = v.comment_id WHERE
>>>>> (v.type = 2 OR v.type IS NULL)"

>>>>> Doctrine seems to be discarding my last leftJoin's with condition. Is
>>>>> this a bug or am I doing something wrong?
>>>>> --

>>>>> - Alex

>>>> --
>>>> Jonathan Wage
>>>> http://www.jwage.com
>>>> http://www.centresource.com

>>> --

>>> - Alex

>> --
>> Jonathan Wage
>> http://www.jwage.com
>> http://www.centresource.com

> --

> - Alex

--
Jonathan Wage
http://www.jwage.com
http://www.centresource.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google