2021-07-15 14:54:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Classes\FTN;
|
|
|
|
|
2024-05-17 12:10:54 +00:00
|
|
|
use App\Models\{Echoarea,Echomail,Netmail};
|
2023-09-12 07:20:09 +00:00
|
|
|
|
2023-06-22 07:36:22 +00:00
|
|
|
/**
|
|
|
|
* Abstract class to hold the common functions for automatic responding to echomail/netmail messages
|
|
|
|
*/
|
2021-07-15 14:54:23 +00:00
|
|
|
abstract class Process
|
|
|
|
{
|
2023-09-12 07:20:09 +00:00
|
|
|
public static function canProcess(string $echoarea): bool
|
|
|
|
{
|
|
|
|
$eao = Echoarea::where('name',$echoarea)->single();
|
|
|
|
|
|
|
|
return $eao && $eao->automsgs;
|
|
|
|
}
|
|
|
|
|
2021-07-15 14:54:23 +00:00
|
|
|
/**
|
|
|
|
* Return TRUE if the process class handled the message.
|
|
|
|
*
|
2024-05-17 12:10:54 +00:00
|
|
|
* @param Echomail|Netmail $mo
|
2021-07-15 14:54:23 +00:00
|
|
|
* @return bool
|
|
|
|
*/
|
2024-05-17 12:10:54 +00:00
|
|
|
abstract public static function handle(Echomail|Netmail $mo): bool;
|
2021-07-15 14:54:23 +00:00
|
|
|
}
|