Usage of method setMatching in 3.4

I have upgraded to CakePHP 3.4 and I’m checking through the 3.4 deprecation list, the migration guide says getMatching() will have to be called after setMatching() to keep the old behavior I’m confused and couldn’t find any documentation on sample on setMatching() and getMatching() functions. How or where should I declare setMatching(). Can anybody please point out to me how do I rewrite the below code using setMatching and getMatching:
TableRegistry::get(‘Students’)->find()
->distinct([ ‘Students.id’])
->matching(‘Studentclassrooms.Classrooms’,
function ($q) use ( $classid ){
return $q->where([ ‘Classrooms.id’ => $classid ]);
});
->enableAutoFields(true);
When I tried the below, I get the error - Unknown method "setMatching”
TableRegistry::get(‘Students’)->find()
->distinct([ ‘Students.id’])
->setMatching(‘Studentclassrooms.Classrooms’,
function ($q) use ( $classid ){
return $q->where([ ‘Classrooms.id’ => $classid ]);
})
->getMatching()
->enableAutoFields(true);