<?php

namespace App\Services;

use App\Models\Location;

class MaintenanceService
{
    //TODO: maintenance script to set locations to inactive if they haven't been updated
    // over 90 days

    //$diff=date_diff($location->updated_at, new DateTime());
    //$days = $diff->format("%R%a days")

    //$interval = $location->updated_at->diff(new DateTime());
    //$days = $interval->format("%a");

    //get all locations and sort which are present in unified or not
    /*
    $sorted    = [];
    $listed    = 0;
    $notlisted = 0;
    foreach (Location::all() as $location) {
        if (array_search($location->url, array_column($unified, 'url'))) {
            ++$listed;
            // locations present in unfied, so updated
            array_push($sorted, [
                'location' => $location,
                'listed'   => true
            ]);
        } else {
            ++$notlisted;
            //locations not present
            array_push($sorted, [
                'location' => $location,
                'listed'   => false
            ]);
        }
    };
    */
}