-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomFieldsModule.php
More file actions
43 lines (38 loc) · 893 Bytes
/
CustomFieldsModule.php
File metadata and controls
43 lines (38 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
*
*
* All rights reserved.
*
* @author Okulov Anton
* @email qantus@mail.ru
* @version 1.0
* @company Studio107
* @site http://studio107.ru
* @date 24/03/15 09:19
*/
namespace Modules\CustomFields;
use Mindy\Base\Mindy;
use Mindy\Base\Module;
class CustomFieldsModule extends Module
{
public $model = null;
public static function preConfigure()
{
Mindy::app()->signal->handler('\Mindy\Orm\Model', 'afterDelete', [self::className(), 'afterDeleteModel']);
}
public function getMenu()
{
return [
'name' => $this->getName(),
'items' => []
];
}
public static function afterDeleteModel($owner)
{
$module = Mindy::app()->getModule('CustomFields');
if ($module && $module->model && $owner->className() == $module->model) {
$owner->clearCustom();
}
}
}