modifyEntrySources hook, comparing two field values
A workaround solution was to essentially do an criteria on the section, return all the records, use a conditional to find out which records have the same "parent ID" and ID", stores those in an array and then use the id criteria for the entry source.

Something like:

$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Entry);
$criteria-&gt;section = 'theSection';
$criteria-&gt;limit = null;
$articles = $criteria-&gt;find();

// For storing matching entries on the conditional below
$ids = [];

foreach ($entries as $entry)
{
     if($entry-&gt;fieldParentId == $entry-&gt;fieldId)
     {
         array_push($ids, $entry-&gt;id);
     }
}


This will then provide a list of ids that match the required criteria, which can then be used for a specific entry source.

This has performance issues though, because you have to get the entire list of entries first each time.