fix #8131 - chinese translations
[Pman.Core] / DataObjects / Core_domain.php
index 3ac00fa..3c50da4 100644 (file)
@@ -1,8 +1,36 @@
 <?php
 <?php
-
-/* 
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
+/**
+ * Table Definition for core_domain
  */
  */
+class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php';
+
+class Pman_Core_DataObjects_Core_domain extends DB_DataObject 
+{
+    ###START_AUTOCODE
+    /* the code below is auto generated do not remove the above tag */
+  
+    public $__table = 'core_domain';
+    public $id;
+    public $domain;
 
 
+    /* the code above is auto generated do not remove the tag below */
+    ###END_AUTOCODE
+    function loadOrCreate($dom)
+    {
+        // should we validate domain?
+        static $cache = array();
+        if (isset($cache[$dom])) {
+            return $cache[$dom];
+        }
+        
+        $cd = DB_DataObject::Factory($this->tableName());
+        if ($cd->get('domain', $dom)) {
+            $cache[$dom] = $cd;
+            return $cd;
+        }
+        $cd->domain = $dom;
+        $cd->insert();
+        $cache[$dom] = $cd;
+        return $cd;
+    }
+}