recursion in dbcriteria->condition

tbl_keyword (id | name)

1 | css

2 | html

3 | javascript

tbl_task_keyword (id_task | id_keyword)

1 | 1

1 | 2

1 | 3

tbl_task (id)


if got a many_many relation in my Task Model

'keywordlist' => array(self::MANY_MANY, 'Keyword', 'task_keyword(id_task, id_keyword)'),

now i search for tasks which have the keyword ‘html’.

 $criteria->condition = "t.blocked = 0 AND t.answered = 0 AND t.date_deadline > NOW()";

        $criteria->order = ' desc';

        $criteria->with = 'keywordlist';

        $criteria->together = true;

        $criteria->compare('', 'html'); 

$tasks = Task::model()->findAll($criteria);

it finds all the right tasks, but only with the searched keyword. but i want all the other keywords of the task as well. is there a method to say, that check if the keywords of the task is for example ‘html’ return the task and all of its keywords?

the result is:

task (keyword: html)

but i need

task (keyword: html, css, javascript)


i made a HAS_MANY and BELONGS_TO relation out of the MANY_MANY relation and now it works.

god knows why…