eager => related where

View: New views
2 Messages — Rating Filter:   Alert me  

eager => related where

by Jeff Surgeson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All

There has been a lot of changes whith regards eager/related sql stuff, trying
to get the following to work, how do I do it with latest svn-core.

$this->list = $this->_model->gallery->fetchAll(
        'eager' => array(
                'gallerycat' => array(
                        'where' => 'gallerycat.name = ?' => 'Cars'
                )
        ),
);

Query works except it is not honouring the where clause anymore.

Jeff Surgeson
_______________________________________________
Solar-talk mailing list
Solar-talk@...
http://mailman-mail5.webfaction.com/listinfo/solar-talk

Re: eager => related where

by Jeff Surgeson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> There has been a lot of changes whith regards eager/related sql stuff,
> trying to get the following to work, how do I do it with latest svn-core.
>
> $this->list = $this->_model->gallery->fetchAll(
> 'eager' => array(
> 'gallerycat' => array(
> 'where' => 'gallerycat.name = ?' => 'Cars'

I solved it by  doing this,

'eager' => array('gallerycat'),
 'where' => 'gallerycat.name = ?' => 'Cars',

Obviously the latest changes has negated the need for all the deeply nested
query stuff that was required to get it to work before.
_______________________________________________
Solar-talk mailing list
Solar-talk@...
http://mailman-mail5.webfaction.com/listinfo/solar-talk