Hi folks. I need your valuable help. Let’s suppose i have that EER (i made it just for post here cause i cant show the real project).
I would like to do something like $document->availableSearchMethods() and get All of available SearchMethod models. It seems easy and i think it is but i just cant figure out how i could do that cause there is a condition: i just want to get the SearchMethods that have the the same id_type and id_operation like my document.
How could i do that in a Yii way?
I am doing it for use a static method like Document::availableSearchMethods($id_type, $id_operation) that returns me an array of SearchMethod objects.
I just would like to know if there is a way to do that using relations and/or scopes.
I will make a new project based on that i showed and post the gii code here more some implementations 'cause i cant post the real project code here.
Thanks.
I have already made so many relationships in many projects (HAS_MANY, MANY_MANY, BELONGS_TO… and so on) but this is a special case not covered in documentation.
For now, what relations would you make to link Document to SearchMethod in this case, having the mentioned conditions?