public static function getSiteIdFromMetadata(DataTable $table)
    {
        $site = $table->getMetadata('site');
        if (empty($site)) {
            return null;
        } else {
            return $site->getId();
        }
    }