45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace com\fwdekker\deathnotifier\tracking;
|
|
|
|
use com\fwdekker\deathnotifier\CliAction;
|
|
|
|
|
|
/**
|
|
* Updates all trackings that users have added.
|
|
*/
|
|
class UpdateTrackingsCliAction extends CliAction
|
|
{
|
|
/**
|
|
* @var TrackingManager the manager through which trackings should be updated
|
|
*/
|
|
private readonly TrackingManager $tracking_manager;
|
|
|
|
|
|
/**
|
|
* Constructs a new `UpdateTrackingsAction`.
|
|
*
|
|
* @param mixed $config the application's configuration
|
|
* @param TrackingManager $tracking_manager the manager through which trackings should be updated
|
|
*/
|
|
public function __construct(mixed $config, TrackingManager $tracking_manager)
|
|
{
|
|
parent::__construct($config, "update-trackings");
|
|
|
|
$this->tracking_manager = $tracking_manager;
|
|
}
|
|
|
|
|
|
/**
|
|
* Updates all trackings that users have added.
|
|
*
|
|
* @return mixed `null`
|
|
*/
|
|
public function handle(): mixed
|
|
{
|
|
$this->tracking_manager->update_trackings($this->tracking_manager->list_all_unique_person_names());
|
|
|
|
return null;
|
|
}
|
|
}
|