1 <?php
2
3 class OrderHandlersDecorator extends DataObjectDecorator {
4 function () {}
5
6 static function add_extension() {
7 $configClass = get_called_class() . '_SiteConfig';
8 if (class_exists($configClass)) {
9 DataObject::add_extension('SiteConfig', $configClass);
10 }
11 Object::add_extension('Order', get_called_class());
12 }
13
14
15 function OnAfterCreateOrder(& $member) {
16 user_error('Создайте нужный способ уведомления');
17 }
18
19
20 function OnAfterChangeStatus($member, $changedStatus, $note) {
21 user_error('Создайте нужный способ уведомления');
22 }
23
24 25 26 27 28 29 30
31 function fill_vars($string) {
32
33 foreach($this->owner->toMap() as $field=>$value) {
34 $string = str_replace('$' . $field, $value, $string);
35 }
36 return $string;
37 }
38 }
39
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-