I am creating a Q&A application in CakePHP, and in some cases I want to exclude my associations. Imagine the following:
I list all the questions on the first page using $ this-> Question-> findAll () ;. Since my model has the following association:
public $hasMany = array('Answer' =>
array('className' => 'Answer',
'order' => 'Answer.created DESC',
'foreignKey' => 'post_id',
'dependent' => true,
'exclusive' => false,
)
);
All answers will be selected on the start page, which is not optimal. How can I do to exclude answers in this particular method?
thanks
alexn source
share