public $country; // string(4) not_null
public $is_system; // int(2)
+
+ public $comptype_id;
+ public $address1;
+ public $address2;
+ public $address3;
+
+
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- function applyFilters($q, $au)
+ function applyFilters($q, $au, $roo)
{
$tn = $this->tableName();
}
if (!empty($q['query']['comptype'])) {
- $this->whereAddIn('comptype', explode(',', $q['query']['comptype']), 'string');
+ $this->whereAddIn($tn.'.comptype', explode(',', $q['query']['comptype']), 'string');
}
$roo->jok('OK');
}
- $roo->jerr('EXIST');
+ $roo->jerror('NOTICE-EXIST-CHECK','EXIST');
}
}
$roo->jok('OK');
}
- $roo->jerr('EXIST');
+ $roo->jerror('NOTICE-EXIST-CHECK','EXIST');
}
if(!empty($q['_merge_id'])){
$companies->insert();
$companies->onInsert(array(), $roo);
}
+
+ function owner()
+ {
+ if (empty($this->owner_id)) {
+ return false;
+ }
+ static $cache = false;
+ if ($cache !== false && isset($cache[$this->owner_id])) {
+ return $cache[$this->owner_id];
+ }
+ $o = DB_DataObject::factory('core_company');
+ if (!$o->get($this->owner_id)) {
+ return false;
+ }
+ $cache[$this->owner_id] = $o;
+ return $o;
+
+ }
+
+ /// look up the company which is the system owner...
static function lookupOwner()
{
static $cache = false;