projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d6f730d
)
DataObjects/Images.php
author
Chris
<chris@roojs.com>
Tue, 9 Oct 2012 11:17:06 +0000
(19:17 +0800)
committer
Chris
<chris@roojs.com>
Tue, 9 Oct 2012 11:17:06 +0000
(19:17 +0800)
DataObjects/Images.php
patch
|
blob
|
history
diff --git
a/DataObjects/Images.php
b/DataObjects/Images.php
index
a15f4a8
..
d328709
100644
(file)
--- a/
DataObjects/Images.php
+++ b/
DataObjects/Images.php
@@
-148,7
+148,29
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
));
}
+
+ function onInsert($request,$roo)
+ {
+
+
+ if(!empty($this->imgtype)){
+ $c = DB_DataObject::factory('Companies');
+
+ if(!$c->get($this->onid)){
+ return;
+ }
+ if(!empty($c->logo_id)){
+ $xx = DB_DataObject::factory('Images');
+ $xx->get($c->logo_id);
+ $xx->delete();
+ }
+
+ $c->logo_id = $this->id;
+ $c->update();
+ }
+
+ }
/**
* deletes all the image instances of it...