152 lines
2.6 KiB
PHP
152 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use DateTime;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(
|
|
* name="sms_message",
|
|
indexes={@ORM\Index(name="date_create_idx", columns={"date_create"})}
|
|
* )
|
|
*/
|
|
class SMSMessage
|
|
{
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
/**
|
|
* @ORM\Column(type="datetime")
|
|
*/
|
|
protected $date_create;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=100)
|
|
*/
|
|
protected $source;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=100)
|
|
*/
|
|
protected $source_alias;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=100)
|
|
*/
|
|
protected $destination;
|
|
|
|
/**
|
|
* @ORM\Column(type="text")
|
|
*/
|
|
protected $message;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=30)
|
|
*/
|
|
protected $status;
|
|
|
|
/**
|
|
* @ORM\Column(type="integer", length=5)
|
|
*/
|
|
protected $reason_code;
|
|
|
|
|
|
public function __construct()
|
|
{
|
|
$this->date_create = new DateTime();
|
|
$this->from = '';
|
|
$this->from_alias = '';
|
|
$this->to = '';
|
|
$this->message = '';
|
|
$this->status = 'created';
|
|
$this->reason_code = 0;
|
|
|
|
// status are:
|
|
// created
|
|
// sent
|
|
// delivered
|
|
// not_delivered
|
|
}
|
|
|
|
public function getID()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getDateCreate()
|
|
{
|
|
return $this->date_create;
|
|
}
|
|
|
|
public function setFrom($from)
|
|
{
|
|
$this->source = $from;
|
|
return $this;
|
|
}
|
|
|
|
public function getFrom()
|
|
{
|
|
return $this->source;
|
|
}
|
|
|
|
public function setFromAlias($alias)
|
|
{
|
|
$this->source_alias = $alias;
|
|
return $this;
|
|
}
|
|
|
|
public function getFromAlias()
|
|
{
|
|
return $this->source_alias;
|
|
}
|
|
|
|
public function setTo($to)
|
|
{
|
|
$this->destination = $to;
|
|
return $this;
|
|
}
|
|
|
|
public function getTo()
|
|
{
|
|
return $this->destination;
|
|
}
|
|
|
|
public function setMessage($message)
|
|
{
|
|
$this->message = $message;
|
|
return $this;
|
|
}
|
|
|
|
public function getMessage()
|
|
{
|
|
return $this->message;
|
|
}
|
|
|
|
public function setStatus($status)
|
|
{
|
|
$this->status = $status;
|
|
return $this;
|
|
}
|
|
|
|
public function getStatus()
|
|
{
|
|
return $this->status;
|
|
}
|
|
|
|
public function setReasonCode($code)
|
|
{
|
|
$this->reason_code = $code;
|
|
return $this;
|
|
}
|
|
|
|
public function getReasonCode()
|
|
{
|
|
return $this->reason_code;
|
|
}
|
|
}
|