Querying relational data in plugin
I ended up doing it this way:

$records = Plugin_CollectionSectionRecord::model()
        -&gt;findAllByAttributes(['collectionId' =&gt; $collectionId]);
}

$ids = [];
foreach($records as $value) {
    $ids[] = $value-&gt;sectionId;
}

$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Entry);
$criteria-&gt;elementType = 'Entry';
$criteria-&gt;sectionId = $ids;
$result = $criteria-&gt;all();
return $result;