[Solar-talk] Selecting Cols w/ eager

Raymond Kolbe rkolbe at gmail.com
Mon Nov 19 12:01:52 CST 2007


>
>
> IIRC you use the relationship name as the table name; e.g., on a
> related "foo", use "foo.colname".  So in the above example you would
> ask for 'cols' => array('user.id', 'user.name'), and not
> "users.colname".


users is my table name (sorry for the confusion)...so users.id would be the
col in that table.

Alternatively, you can set up a "has-one limited_user" and define the
> limited_user relation cols to be only the cols you want.  That can be
> in addition to the regular "user" when you want all the cols.


I think this would be the best option right now. However, I think I would
like to see a way to call the cols on the fly for all related models/tables
involved.

Thanks again,
Raymond K.

Let me know if that helps or not.

On Nov 19, 2007 12:19 PM, Paul M Jones <pmjones at ciaweb.net> wrote:

>
> On Nov 19, 2007, at 2:57 AM, Ian Szewczyk wrote:
>
> > Note to Paul:
> >
> > Please, for the love of God if you have something like
> >
> > @param array $opts Additional options for the relationship.
> >
> > in the inline documentation please define what those opts are ;p
>
> Understood.  :-)
>
> I took a quick look at Solar_Sql_Model::fetchAll() and they seem to
> be there, although incomplete.
>
>   <http://solarphp.com/class/Solar_Sql_Model/fetchAll()<http://solarphp.com/class/Solar_Sql_Model/fetchAll%28%29>
> >
>
> Granted, there should be more info, but that'll probably be part of
> narrative manual docs, rather than API docs.
>
> Does that help?
>
>
>
> --
>
> Paul M. Jones  <http://paul-m-jones.com>
>
> Solar: Simple Object Library and Application Repository
> for PHP5.  <http://solarphp.com>
>
> Join the Solar community wiki!  <http://solarphp.org>
>
> Savant: The simple, elegant, and powerful solution for
> templates in PHP.  <http://phpsavant.com>
>
>
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20071119/16e4fbc5/attachment.html


More information about the Solar-talk mailing list