| |
doctrine-user |
Anyone? What am I doing wrong?
On 3 июл, 22:58, mich <michaile...@gmail.com> wrote:
> update blog_entry set comment_number = (select count(*) from
> How I can write such query in DQL? I tried:
> $q = Doctrine_Query::create()
> but it throws exception "Unknown component alias Comment".
> blog_comment where blog_comment.root = blog_entry.id)
> ->update('Blog_Entry Entry')
> ->set('Entry.comment_number', '(SELECT COUNT(Comment.id)
> FROM Entry.Blog_Comment Comment WHERE Comment.root = Entry.id)')
> ->execute()
> ;