0

I have a pretty straightforward Model relationship: a POST hasMany COMMENTs.

They're both correctly related to each other and they both have the Containable attribute turned on.

Is there any way to perform a find on POSTs and return an array of just POST ids and each of its COMMENT ids?

I can easily contain other relationships, but not hasMany. Right now I'm just performing a find at recursive level 0 and grabbing the fields that I need. But this array has so much junk I don't need in it, like USER info and tags. I'd rather trim all of that stuff out and get a neat array returned. Please help.

Also, first post, please forgive me if I did anything wrong.

AD7six
  • 63,116
  • 12
  • 91
  • 123
oppositeday
  • 113
  • 1
  • 5
  • You need to include some code (the action where you want to performe this find on POSTs and an example of what you've tried). Explain a bit better what you want to do, and why does it fail. – Nunser Jun 24 '13 at 14:48
  • are you adding a belongsTo in Comment.php? If you do this all should work just fine! – amstegraf Jun 25 '13 at 14:16

0 Answers0