I am using NeoTable and Doctrine for database interactions with php, I need to add one where condition for a joined table, below is the controller code.
TutorTable::create($this->userRecord, $this->translator, $this->ismobile)
->base('student')
->parentTable('Student')
->childTable('Tutor')
->recordTemplateName('record')
->parentField('studentID')
->childField('tutorID')
->noAutoSuffix()
->m('ctrac')
->relateTable("StdIins")
->customRecordTemplate()
->getRecords($this->view);
$debug ? neolog("post tutor") : false
There are two models , Student and instructor, one student can have many Tutors and vise versa, StdIins is the intermediate table that stores the relations between student and instructors, it contains columns StudentID, tutorID, centerID. I want to add a where condition in above code so that it fetches records for a specific centerID, Does anyone have any idea?
I tried putting a where condition directly for Studenttoins but it resulted in doctrine exception.