public function getReferencingRows($id, $table, $viaColumn = null, Filtering $filtering = null, $strategy = null)
{
if ($viaColumn === null) {
$viaColumn = $this->mapper->getRelationshipColumn($table, $this->table);
}
$referencingResult = $this->getReferencingResult($table, $viaColumn, $filtering, $strategy);
$resultHash = spl_object_hash($referencingResult);
if (!isset($this->index[$resultHash])) {
$column = $this->isAlias($viaColumn) ? $this->trimAlias($viaColumn) : $viaColumn;
$this->index[$resultHash] = [];
foreach ($referencingResult as $key => $row) {
$this->index[$resultHash][$row[$column]][] = new Row($referencingResult, $key);
}
}
if (!isset($this->index[$resultHash][$id])) {
return [];
}
return $this->index[$resultHash][$id];
}