Monday, August 30, 2010

Re: is it possible to define "empty" virtual fields?

Not really quite what i meant....

my query basically selects a field called "firstpost", which is a table joined on another query later on...

doesn't matter, got around the issue by manually overriding the hasFields() method to force pagination to work properly.


On Tue, Aug 31, 2010 at 2:40 AM, cricket <zijn.digital@gmail.com> wrote:
On Sun, Aug 29, 2010 at 9:22 PM, Greg Skerman <gskerman@gmail.com> wrote:
> Hi,
>
> Wondering if its possible to define virtual fields without actually defining
> what the virtual field points at?

So, it would be assigned to everything and nothing?

> I want to do this later on in my query via a join, but need to define the
> virtual field so that pagination will work as expected.

How could it "work as expected" if both everything and nothing are
expected of the virtual field?

I suppose you could try defining it as the empty string, then
assigning something later to it.

$this->virtualFields['foo'] = 'bar';

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: