projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DataObjects/Core_enum.php
[Pman.Core]
/
DataObjects
/
Core_enum.php
diff --git
a/DataObjects/Core_enum.php
b/DataObjects/Core_enum.php
index
8ca0f22
..
3a3b6e2
100644
(file)
--- a/
DataObjects/Core_enum.php
+++ b/
DataObjects/Core_enum.php
@@
-338,7
+338,7
@@
class Pman_Core_DataObjects_Core_enum extends DB_DataObject
}
}
- function merge($
id
, $roo)
+ function merge($
to
, $roo)
{
$affects = array();
{
$affects = array();
@@
-361,25
+361,22
@@
class Pman_Core_DataObjects_Core_enum extends DB_DataObject
$chk = DB_DataObject::factory($ka[0]);
if (!is_a($chk,'DB_DataObject')) {
$chk = DB_DataObject::factory($ka[0]);
if (!is_a($chk,'DB_DataObject')) {
- $
this
->jerr('Unable to load referenced table, check the links config: ' .$ka[0]);
+ $
roo
->jerr('Unable to load referenced table, check the links config: ' .$ka[0]);
}
}
- // print_r(array($chk->tablename() , $ka[1] , $xx->tablename() , $this->key ));
- $chk->{$ka[1]} =
$xx->{$this->key}
;
+
+ $chk->{$ka[1]} =
$this->id
;
- if (count($chk->keys())) {
- $matches = $chk->count();
- } else {
- //DB_DataObject::DebugLevel(1);
- $matches = $chk->count($ka[1]);
+ foreach ($chk->fetchAll() as $c){
+ $cc = clone ($c);
+ $c->{$ka[1]} = $to;
+ $c->update($cc);
}
}
-
- if ($matches) {
- $chk->_match_key = $ka[1];
- $match_ar[] = clone($chk);
- continue;
- }
}
}
+ $this->delete();
+
+ $roo->jok('Merged');
+
}
}