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) {
26 $this->transObj = DB_DataObject::Factory('core_enum');
28 $this->transObj->query('BEGIN');
30 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
32 $this->modules = $this->modulesList();
44 $this->etype = DB_DataObject::factory('core_enum');
45 $this->etype->setFrom(array(
47 'name' => 'Core.NotifyType',
48 'display_name' => 'Core.NotifyType',
52 if($this->etype->find(true)){
56 $this->etype->insert();
61 foreach ($this->modules as $m){
62 $file = $this->rootDir. "/Pman/$m/Core.NotifyType.json";
64 if(!file_exists($file)){
68 $this->defaults[$m] = json_decode(file_get_contents($file), true);