mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Add notification method on order entity
This commit is contained in:
@@ -20,12 +20,17 @@ use Gedmo\Mapping\Annotation as Gedmo;
|
|||||||
*/
|
*/
|
||||||
class Order
|
class Order
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const NOTIFY_MAIL = 'mail';
|
||||||
|
|
||||||
|
const NOTIFY_WEBHOOK = 'webhook';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="integer")
|
* @ORM\Column(type="integer")
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue
|
* @ORM\GeneratedValue
|
||||||
*/
|
*/
|
||||||
private $id;
|
private $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity="User")
|
* @ORM\ManyToOne(targetEntity="User")
|
||||||
@@ -67,6 +72,11 @@ class Order
|
|||||||
*/
|
*/
|
||||||
private $basket;
|
private $basket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=32, name="notification_method")
|
||||||
|
*/
|
||||||
|
private $notificationMethod = 'email';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
@@ -280,4 +290,26 @@ class Order
|
|||||||
{
|
{
|
||||||
return $this->basket;
|
return $this->basket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string The name of the notification method that will be used to handle this order's status change
|
||||||
|
* notifications.
|
||||||
|
*/
|
||||||
|
public function getNotificationMethod()
|
||||||
|
{
|
||||||
|
return $this->notificationMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $methodName Sets the name of the notification method to handle this order's status change
|
||||||
|
* notifications.
|
||||||
|
*/
|
||||||
|
public function setNotificationMethod($methodName)
|
||||||
|
{
|
||||||
|
if (trim($methodName) == '') {
|
||||||
|
$methodName = self::NOTIFY_MAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->notificationMethod = $methodName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user