3 require_once 'Pman/Roo.php';
5 class Pman_Core_Import_Core_notify extends Pman_Roo
7 static $cli_desc = "Create Core.NotifyType from core notify";
9 static $cli_opts = array(
15 if (!HTML_FlexyFramework::get()->cli) {
23 var $defaults = array();
28 $this->transObj = DB_DataObject::Factory('core_enum');
30 $this->transObj->query('BEGIN');
32 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
34 $this->modules = $this->modulesList();
38 print_r($this->defaults);exit;
48 $this->etype = DB_DataObject::factory('core_enum');
49 $this->etype->setFrom(array(
51 'name' => 'Core.NotifyType',
52 'display_name' => 'Core.NotifyType',
56 if($this->etype->find(true)){
60 $this->etype->insert();
65 foreach ($this->modules as $m){
66 $file = $this->rootDir. "/Pman/$m/Core.NotifyType.json";
68 if(!file_exists($file)){
72 $this->defaults = array_merge($this->defaults, json_decode(file_get_contents($file), true)) ;