diff --git a/lib/Alchemy/Phrasea/Model/Entities/Order.php b/lib/Alchemy/Phrasea/Model/Entities/Order.php index 4363343438..58bacd36ba 100644 --- a/lib/Alchemy/Phrasea/Model/Entities/Order.php +++ b/lib/Alchemy/Phrasea/Model/Entities/Order.php @@ -20,12 +20,17 @@ use Gedmo\Mapping\Annotation as Gedmo; */ class Order { + + const NOTIFY_MAIL = 'mail'; + + const NOTIFY_WEBHOOK = 'webhook'; + /** * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue */ - private $id; + private $id; /** * @ORM\ManyToOne(targetEntity="User") @@ -67,6 +72,11 @@ class Order */ private $basket; + /** + * @ORM\Column(type="string", length=32, name="notification_method") + */ + private $notificationMethod = 'email'; + /** * Constructor */ @@ -280,4 +290,26 @@ class Order { 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; + } }