Answer the question
In order to leave comments, you need to log in
How to correctly compose CDbCriteria many-to-many in Yii?
Good afternoon!
There are three tables:
t_service
-----------
CODE
NAME
mc_faq
----------
CODE
NAME
DESCRIPTION
l_service_22_faq
----------
CODE
CODE_1
CODE_2
Actually 3rd the plate connects the first 2.
Models:
Service , Faq , LService22Faq
Relationships:
CODE: SELECT ALL
public function relations()
{
return array(
'faq'=>array(self::MANY_MANY, 'Faq',
'l_service_22_faq(CODE_1, CODE_2)'),
);
}
$faq = new CActiveDataProvider('Faq', array(
'criteria' => array(
'condition' => .... ,
),
));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question