public function getUidOfOverlay($table, $field, $uid)
    {
        // when no language is set at all we do not need to overlay
        if (!isset($this->tsfe->sys_language_uid)) {
            return $uid;
        }
        // when no language is set we can return the passed recordUid
        if (!$this->tsfe->sys_language_uid > 0) {
            return $uid;
        }

        $record = $this->getRecord($table, $uid);

        // when the overlay is not an array, we return the localRecordUid
        if (!is_array($record)) {
            return $uid;
        }

        $overlayUid = $this->getLocalRecordUidFromOverlay($table, $record);
        $uid = ($overlayUid !== 0) ? $overlayUid : $uid;
        return $uid;
    }