E
E
EVOSandru62015-02-08 05:07:20
Yii
EVOSandru6, 2015-02-08 05:07:20

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)'),
        );
    }

I threw in about what I need (for the subgrid):
$faq = new CActiveDataProvider('Faq', array(
    'criteria' => array(
        'condition' => .... ,
    ),
));

How do I, having a service code, make the CDbCriteria criterion to pull out all the Faq (question-answers) for a given service? For 1:
1 I
know how, for MANY:MANY I can’t figure it out(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-02-08
@joinex

stackoverflow.com/questions/8044552/search-in-y...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question