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->etype();
33         
34         
35         
36     }
37     
38     function etype()
39     {
40         $this->etype = DB_DataObject::factory('core_enum');
41         $this->etype->setFrom(array(
42             'etype' => '',
43             'name' => 'Core.NotifyType',
44             'display_name' => 'Core.NotifyType',
45             'active' => 1
46         ));
47         
48         if($this->etype->find(true)){
49             return;
50         }
51         
52         $this->etype->insert();
53     }
54     
55     function modules()
56     {
57         
58     }
59 }