public function cleanOld()
    {
        $siteconfig = SiteConfig::current_site_config();
        $date = $siteconfig->dbobject("LastEstimateClean");
        $request = Injector::inst()->get(HTTPRequest::class);

        if (!$date || ($date && !$date->IsToday())) {
            $task = Injector::inst()->create(CleanExpiredEstimatesTask::class);
            $task->setSilent(true);
            $task->run($request);
            $siteconfig->LastEstimateClean = DBDatetime::now()->Value;
            $siteconfig->write();
        }
    }
public function cleanOld()
    {
        $siteconfig = SiteConfig::current_site_config();
        $date = $siteconfig->dbobject("LastEstimateClean");
        $request = Injector::inst()->get(HTTPRequest::class);

        if (!$date || ($date && !$date->IsToday())) {
            $task = Injector::inst()->create(CleanExpiredEstimatesTask::class);
            $task->setSilent(true);
            $task->run($request);
            $siteconfig->LastEstimateClean = DBDatetime::now()->Value;
            $siteconfig->write();
        }
    }
public function cleanOld ( ) { $ siteconfig = SiteConfig :: current_site_config ( ) ; $ date = $ siteconfig -> dbobject ( "LastEstimateClean" ) ; $ request = Injector :: inst ( ) -> get ( HTTPRequest :: class ) ; if ( ! $ date || ( $ date && ! $ date -> IsToday ( ) ) ) { $ task = Injector :: inst ( ) -> create ( CleanExpiredEstimatesTask :: class ) ; $ task -> setSilent ( true ) ; $ task -> run ( $ request ) ; $ siteconfig -> LastEstimateClean = DBDatetime :: now ( ) -> Value ; $ siteconfig -> write ( ) ; } }
Run the task to clean old shopping carts

@return null
Run the task to clean old shopping carts