Hi everybody,
I'm trying to create a simple cakephp application which handles posts
and comments (like the one presented in the tutorial); I have a Post
model which *hasMany* Comments, and I have a Comment which *belongsTo*
to a Post.
I would like to use Post->hasMany['fields'] variable to reduce the set
of fetched attributes, but for some strange reasons, I'm getting also
attributes not present in the specified array; in particular, I get
all the specified attributes plus the foreignKey (e.g. if my Comment
is composed by an 'id', a 'body', a couple of date fields and
'post_id' (our foreignKey), and if I set *fields* to array('id'), I
get back both 'id' and 'post_id' attributes).
However, while I fetch the Post associated to a Comment, the list of
fetched attributes seems to match the one specified in the association
definition.
Is this a bug, or is there anything I'm not taking into account?
Regards,
Matteo
--
http://www.matteolandi.net/
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php