{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
-
public $__table = 'core_enum'; // table name
public $id; // int(11) not_null primary_key auto_increment
public $etype; // string(32) not_null
if (!empty($q['query']['empty_etype'])) {
$this->whereAdd("core_enum.etype = ''");
}
+
// this should be handled by roo... using '!name[0]' ....
if(!empty($q['!name'])){
function beforeUpdate($old, $request,$roo)
{
+
+ /* multiple id merge */
if(!empty($request['_merge_id'])){
- $this->merge($request['_merge_id'], $roo);
+ if(!empty($request['_ids'])){
+ //DB_DataObject::DebugLevel(1);
+ $ce = DB_DataObject::factory('core_enum');
+ $ce->whereAddIn("id", explode(",", $request['_ids']), "int");
+
+ foreach($ce->fetchAll() as $mergeItem){
+
+ $mergeItem->merge($request['_merge_id'], $roo);
+ }
+ } else {
+ $this->merge($request['_merge_id'], $roo);
+ }
+ $roo->jok('Merged');
}
$tn = $this->tableName();
$seq_id = $t->seqid+1;
}
}
+
foreach($data as $row) {
$t = DB_DAtaObject::Factory('core_enum');
$t->name = isset($row['name']) ? $row['name'] : '';
- if (empty($t->name)) {
+ if (empty($t->name) && $t->name != 0) {
print_R($data);
die("ERROR: invalid name used for core_enum\n\n");
}
function merge($merge_to, $roo)
{
$affects = array();
-
- $all_links = $GLOBALS['_DB_DATAOBJECT']['LINKS'][$this->_database];
+ $tn = $this->tableName();
+ $x = $this->factory($tn);
+ $all_links = $x->databaseLinks();
foreach($all_links as $tbl => $links) {
foreach($links as $col => $totbl_col) {
$this->delete();
- $roo->jok('Merged');
+
}