projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
63f03bc
)
DataObjects/Core_event_audit.php
author
Alan Knowles
<alan@roojs.com>
Wed, 28 Sep 2011 04:40:17 +0000
(12:40 +0800)
committer
Alan Knowles
<alan@roojs.com>
Wed, 28 Sep 2011 04:40:17 +0000
(12:40 +0800)
DataObjects/Core_event_audit.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_event_audit.php
b/DataObjects/Core_event_audit.php
index
98bfb2a
..
a0eacce
100644
(file)
--- a/
DataObjects/Core_event_audit.php
+++ b/
DataObjects/Core_event_audit.php
@@
-59,8
+59,26
@@
class Pman_Core_DataObjects_Core_event_audit extends DB_DataObject
return $x->newvalue($event);
}
return $x->newvalue($event);
}
-
-
+ function findLast($event, $name)
+ {
+ $x = DB_DataObject::factory('core_event_audit');
+ $x->autoJoin();
+ $x->selectAdd();
+ $x->selectAdd('core_event_audit.id as id');
+
+ $x->name = $name;
+ $x->whereAdd("
+ Events.on_table= '{$event->on_table}' AND
+ Events.on_id= '{$event->on_id}'
+ ");
+ $x->orderBy('Events.event_when DESC');
+ $x->limit(1);
+ if (!$x->find(true)) {
+ return 0;
+ }
+ return $x->id;
+
+ }