public function saveDashboardWidgets(string $dashboardId, array $widgets = []): bool
    {
        $result = false;

        if (empty($widgets)) {
            return $result;
        }

        foreach ($widgets as $item) {
            $widget = [
                'dashboard_id' => $dashboardId,
                'widget_id' => $item['id'],
                'widget_type' => $item['type'],
                'widget_options' => json_encode($item),
                'row' => 0,
                'column' => 0,
            ];

            $entity = $this->newEntity();
            $entity = $this->patchEntity($entity, $widget);

            if ($this->save($entity)) {
                $result = true;
            }
        }

        return $result;
    }