Import/Core_notify.php
[Pman.Core] / Import / Core_notify.php
1 <?php
2
3 require_once 'Pman/Roo.php';
4
5 class Pman_Core_Import_Core_notify extends Pman_Roo 
6 {
7     static $cli_desc = "Create Core.NotifyType from core notify"; 
8     
9     static $cli_opts = array(
10         
11     );
12     
13     function getAuth()
14     {
15         if (!HTML_FlexyFramework::get()->cli) {
16             return false;
17         }
18         
19         return true;
20         
21     }
22
23     function get()
24     {   
25         
26         $this->transObj = DB_DataObject::Factory('core_enum');
27         
28         $this->transObj->query('BEGIN');
29         
30         PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
31         
32         $this->modules = $this->modulesList();
33         print_R($this->modules);exit;
34         $this->etype();
35         
36         
37         
38     }
39     
40     function etype()
41     {
42         $this->etype = DB_DataObject::factory('core_enum');
43         $this->etype->setFrom(array(
44             'etype' => '',
45             'name' => 'Core.NotifyType',
46             'display_name' => 'Core.NotifyType',
47             'active' => 1
48         ));
49         
50         if($this->etype->find(true)){
51             return;
52         }
53         
54         $this->etype->insert();
55     }
56 }