fix #8131 - chinese translations
[Pman.Core] / DataObjects / Core_domain.php
1 <?php
2 /**
3  * Table Definition for core_domain
4  */
5 class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php';
6
7 class Pman_Core_DataObjects_Core_domain extends DB_DataObject 
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11   
12     public $__table = 'core_domain';
13     public $id;
14     public $domain;
15
16     /* the code above is auto generated do not remove the tag below */
17     ###END_AUTOCODE
18     function loadOrCreate($dom)
19     {
20         // should we validate domain?
21         static $cache = array();
22         if (isset($cache[$dom])) {
23             return $cache[$dom];
24         }
25         
26         $cd = DB_DataObject::Factory($this->tableName());
27         if ($cd->get('domain', $dom)) {
28             $cache[$dom] = $cd;
29             return $cd;
30         }
31         $cd->domain = $dom;
32         $cd->insert();
33         $cache[$dom] = $cd;
34         return $cd;
35     }
36 }