Import/Core_notify.php
authorEdward <edward@roojs.com>
Wed, 11 Feb 2015 07:35:47 +0000 (15:35 +0800)
committerEdward <edward@roojs.com>
Wed, 11 Feb 2015 07:35:47 +0000 (15:35 +0800)
Import/Core_notify.php

index 3e558ca..6fa0b4a 100644 (file)
@@ -1,7 +1,51 @@
 <?php
 
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-?>
+require_once 'Pman/Roo.php';
+
+class Pman_Core_Import_Core_notify extends Pman_Roo 
+{
+    static $cli_desc = "Create Core.NotifyType from core notify"; 
+    
+    static $cli_opts = array(
+        
+    );
+    
+    function getAuth()
+    {
+        if (!HTML_FlexyFramework::get()->cli) {
+            return false;
+        }
+        
+        return true;
+        
+    }
+
+    function get()
+    {   
+        
+        $this->transObj = DB_DataObject::Factory('core_enum');
+        
+        $this->transObj->query('BEGIN');
+        
+        PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
+        
+        
+    }
+    
+    function etype()
+    {
+        $this->etype = DB_DataObject::factory('core_enum');
+        $this->etype->setFrom(array(
+            'etype' => '',
+            'name' => 'Core.NotifyType',
+            'display_name' => 'Core.NotifyType',
+            'active' => 1
+        ));
+        
+        if($this->etype->find(true)){
+            return;
+        }
+        
+        $this->etype->insert();
+    }
+}
\ No newline at end of file