2021-02-04 09:02:19 -05:00
|
|
|
<?php
|
|
|
|
|
|
2026-02-23 17:12:09 -05:00
|
|
|
// SPDX-FileCopyrightText: 2021 Icinga GmbH <https://icinga.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2021-02-04 09:02:19 -05:00
|
|
|
|
|
|
|
|
namespace Icinga\Module\Icingadb\Command;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base class for commands sent to an Icinga instance
|
|
|
|
|
*/
|
|
|
|
|
abstract class IcingaCommand
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Get the name of the command
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2021-09-22 04:21:15 -04:00
|
|
|
public function getName(): string
|
2021-02-04 09:02:19 -05:00
|
|
|
{
|
|
|
|
|
$nsParts = explode('\\', get_called_class());
|
|
|
|
|
return substr_replace(end($nsParts), '', -7); // Remove 'Command' Suffix
|
|
|
|
|
}
|
|
|
|
|
}
|