public function invalidateRelated($nodeIdList)
    {
        if (!$nodeIdList) {
            return;
        }

        $this
            ->database
            ->query("
                UPDATE {ucms_seo_route}
                SET
                    is_outdated = 1
                WHERE
                    is_outdated = 0
                    AND is_protected = 0
                    AND menu_id IS NOT NULL
                    AND menu_id IN (
                        SELECT
                            DISTINCT(i.menu_id)
                        FROM {umenu_item} i
                        WHERE
                            i.node_id IN (:nodeIdList)
                    )
            ", [':nodeIdList' => $nodeIdList])
        ;

        // This is sad, but when data is not consistent and menu identifier
        // is not set, we must wipe out the complete site cache instead, but
        // hopefully, it won't happen again once we'll have fixed the item
        // insertion.
        $this
            ->database
            ->query("
                UPDATE {ucms_seo_route}
                SET
                    is_outdated = 1
                WHERE
                    is_outdated = 0
                    AND is_protected = 0
                    AND menu_id IS NULL
                    AND site_id IN (
                        SELECT
                            DISTINCT(i.site_id)
                        FROM {umenu_item} i
                        WHERE
                            i.node_id IN (:nodeIdList)
                    )
            ", [':nodeIdList' => $nodeIdList])
        ;
    }