Monday, January 3, 2011

Problem with virtual fields and a findBy Method which should return null (or empty)

I created a model with some virtual fields. When i search for an entry
in that specific table with this model - like test->findByName('xyz')
(this entry is NOT in the table) - I get an array returned which has
the index of the model and in this index the listing of all columns
plus the virtual fields (as an index). Every index has no value but i
can not check for an empty array in my controller (because it IS not
empty). Is this a common problem in cake? (I could filter for this in
the afterFind callback but i ask myself if there is a better
workaround?)


Thank you very much for your help!

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: