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