protected function mapExists(array $map, $modelName, $tableName = null)
    {
        // First we try to find an entry by model-name
        // if not found, we try to find one using the table-name if a value is provided
        $found = isset($map['model-name']) && $map['model-name'] == $modelName;

        if (!$found && !empty($tableName)) {
            $found = isset($map['table-name']) && $map['table-name'] == $tableName;
        }

        return $found;
    }