Plugin development - Querying related data 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()-&gt;entries-&gt;getEntryById($variables['pathId']);


So far so good, but now I want to get all related 'Entries', so I do the following:

$entries=$course-&gt;entries-&gt;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?
I think this works but is it an acceptable solution:

$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Entry);
$criteria-&gt;section = 'checkin';

$criteria-&gt;relatedTo = array(
     'targetElement' =&gt; $entry,
     'field' =&gt; $field
);

$checkin = craft()-&gt;elements-&gt;findElements($criteria);