Ok, I solved it like this: model A HAS_MANY model B, so I redefined the relationship method to the following:
public function relations() { return array( 'messages' => array(self::HAS_MANY, 'WallMessages', 'liga_id', 'condition'=>'specific_post.parent_message_id IS NULL', 'order'=>'specific_post.date DESC', 'alias'=>'specific_post'), ); }
Therefore, I only compare the date of these messages without a parent identifier. The disadvantage is that I have to access each message "child messages" ... but well, I could not find another workaround. Thank you all for your help!
Soph
source share