I am working on a Craft plugin.
I have a main entities are 'Courses' and 'Entries'. If I click on an Entries in the CMS there is an option to select and associated 'Course'.
In my controller I can get a Course as follows:
$course = craft()->entries->getEntryById($variables['pathId']);
So far so good, but now I want to get all related 'Entries', so I do the following:
$entries=$course->entries->find();
This gives the following error:
Property "Craft\EntryModel.entries" is not defined.
What am I doing wrong? Clearly the two are related so why isn't this method working?