Changeset 90 for trunk/Packages/Common/Application.php
- Timestamp:
- Oct 4, 2019, 10:31:38 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Application.php
r69 r90 1 1 <?php 2 3 class ModelDef 4 { 5 var $OnChange; 6 7 function __construct() 8 { 9 $this->OnChange = array(); 10 } 11 12 function DoOnChange() 13 { 14 foreach($this->OnChange as $Callback) 15 { 16 call_user_func($Callback); 17 } 18 } 19 20 function RegisterOnChange($SysName, $Callback) 21 { 22 $this->OnChange[$SysName] = $Callback; 23 } 24 25 function UnregisterOnChange($SysName) 26 { 27 unset($this->OnChange[$SysName]); 28 } 29 } 2 30 3 31 class Application extends System … … 7 35 var $ModuleManager; 8 36 var $Modules; 9 37 var $Models; 38 10 39 function __construct() 11 40 { … … 14 43 $this->ModuleManager = new AppModuleManager($this); 15 44 $this->Modules = array(); 45 $this->Models = array(); 46 } 47 48 function RegisterModel($SysName, $Model) 49 { 50 $NewModelDef = new ModelDef(); 51 $NewModelDef->Title = $Model['Title']; 52 $this->Models[$SysName] = $NewModelDef; 16 53 } 17 54 55 function UnregisterModel($SysName) 56 { 57 unset($this->Models[$SysName]); 58 } 59 18 60 function Run() 19 61 {
Note:
See TracChangeset
for help on using the changeset viewer.