<?php

namespace DEVELUXSCT\HTMLGenerators;

class DashboardWidget
{
    public static function generate_dashboard_widget()
    {
        $img_url = DEVELUXSCT_URL . 'assets/dashboard_widget/images/';
        $all_timers_count = self::get_all_timers_count();
        ob_start();
        include DEVELUXSCT_DWPC_PATH . 'templates/general/dashboard_widget/dashboard_widget.php';

        $final_result = ob_get_contents();
        ob_end_clean();
        return $final_result;
    }
    public static function get_all_timers_count(): int
    {
        $all_timers = get_posts([
            'post_type' => 'develuxsct_timer',
            'fields' => 'ids',
            'numberposts' => -1,
        ]);
        return count($all_timers);
    }
}