Multiple relations to the same same table

Hi everyone. Until this moment I thought that I understand associations well, nevertheless, this one simple problem showed me that I was wrong.

I have four databases and I want to define multiple associations to one of them, see drawing below:

I set up my models like this:

SubjectsTable.php

TransmittersTable.php

RulingsTable.php

MeasurementsTable.php
MeasurementsTable.php

but I am always getting errors like this one:

(errors are of the same type for each controller, i.e. Transmitters, Rulings and Measurmeents controllers, respectively)

Please can anyone tell me what is wrong with my associations? What I do wrong?

Thank you very much!

Can you share the line of code that makes this error happen? Like, you’ll be doing something like $this->Rulings->find()->contain('Applicants').

Thank you @Zuluru. I got the problem. I was editing SubjectsTable.php in my backup folder while the current version active on server remained unchanged. Hence, CakePHP could not find the association. Here is solution for RulingsController.php (MeasurementController.php and TransmitterController.php are analogous):

solution

And for those who were interested, here is my SubjectsController.php

Finally, it is necessary to preprare view template for each “index” actions for owners, applicants and evaluators (view template for applicants (i.e. applicants “index” action) is below):

I hope that this post wil help you to fix your problem.