Hi,
I have following code:
$pendingReviewers = new DataList('Member');
foreach ($reviews as $rev) {
$temp = $rev->getManyManyComponents('Reviewers','ReviewerStatus = 0');
Debug::dump($temp->count());
$pendingReviewers->addMany($temp);
Debug::dump($pendingReviewers->count());
}
What is interesting about this is that the two dumps don't produce the same output (but they should since I am testing this on one Dataobject). First one produces 0, while second outputs 1 (correct is 0). Why is this?
A quick look at the getManyManyComponents method makes me think that filtering is done at a too late stage, and is actually done on a wrong classmodel. I'd really appreciate a comment from someone more sure of this.
Furthermore, I've tried filtering these results in various ways using DataList, but with no luck. Only way I could've solved this is when using ArrayList and then pushing data to the list, but this is not satisfying for me cause query execution occurs too early (since there can be many reviews).