mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Extract function from core of daemons
This commit is contained in:
parent
67c7753e7d
commit
ac64fe9d2d
3 changed files with 80 additions and 24 deletions
|
@ -377,6 +377,26 @@ namespace controllers\internals;
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a scheduled message
|
||||
* @param int $id_scheduled : Id of the message to send
|
||||
* @param string $text : Text of the message
|
||||
* @param string $origin : Origin of the message
|
||||
* @param string $destination : Destination of the message
|
||||
* @param bool $flash : Is the message a flash sms
|
||||
* return bool: false on error, true else
|
||||
*/
|
||||
public function send (int $id_scheduled, string $text, string $origin, string $destination, bool $flash) : bool
|
||||
{
|
||||
//TODO : Do the sending (càd, instanciate a phone adapter and send the message)
|
||||
|
||||
$now = new \DateTime();
|
||||
$at = $now->format('Y-m-d H:i:s');
|
||||
$internal_sended = new \controllers\internals\Sended($this->bdd);
|
||||
$this->delete($id_scheduled);
|
||||
return $internal_sended->create($at, $text, $origin, $destination, $flash);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return numbers for a scheduled message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue