Added Email Logging for Emailnotification class
This commit is contained in:
@@ -20,6 +20,7 @@ class mfBaseModel {
|
||||
protected $edit;
|
||||
private $worker;
|
||||
protected $forcestr;
|
||||
protected $forcebinary;
|
||||
|
||||
protected $mode = "new";
|
||||
protected $saved = 0;
|
||||
@@ -158,17 +159,28 @@ class mfBaseModel {
|
||||
$fields = $this->buildFields();
|
||||
|
||||
$forcestr = array();
|
||||
|
||||
if(!$this->fieldprefix && is_array($this->forcestr) && count($this->forcestr)) {
|
||||
$forcestr = $this->forcestr;
|
||||
}
|
||||
$forcebinary = array();
|
||||
|
||||
if(is_array($this->forcestr) && count($this->forcestr)) {
|
||||
foreach($this->forcestr as $fstr) {
|
||||
$forcestr[] = $this->fieldprefix . "_$fstr";
|
||||
if ($this->fieldprefix) {
|
||||
foreach ($this->forcestr as $fstr) {
|
||||
$forcestr[] = $this->fieldprefix . "_$fstr";
|
||||
}
|
||||
} else {
|
||||
$forcestr = $this->forcestr;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($this->forcebinary) && count($this->forcebinary)) {
|
||||
if ($this->fieldprefix) {
|
||||
foreach ($this->forcebinary as $fstr) {
|
||||
$forcebinary[] = $this->fieldprefix . "_$fstr";
|
||||
}
|
||||
} else {
|
||||
$forcebinary = $this->forcebinary;
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_array($fields) or !count($fields)) {
|
||||
return false;
|
||||
}
|
||||
@@ -179,7 +191,7 @@ class mfBaseModel {
|
||||
if($this->fieldprefix) {
|
||||
$where = "`" . $this->fieldprefix . "_id`=$id";
|
||||
}
|
||||
if($this->db->update($this->table, $fields, $where, $forcestr)) {
|
||||
if($this->db->update($this->table, $fields, $where, $forcestr, $forcebinary)) {
|
||||
$this->saved++;
|
||||
if(method_exists($this, "afterSave")) {
|
||||
$this->afterSave($_params);
|
||||
@@ -187,7 +199,7 @@ class mfBaseModel {
|
||||
return $id;
|
||||
}
|
||||
} else {
|
||||
if($this->db->insert($this->table, $fields, $forcestr)) {
|
||||
if($this->db->insert($this->table, $fields, $forcestr, $forcebinary)) {
|
||||
$id = $this->db->insert_id;
|
||||
$this->id = $id;
|
||||
$this->saved++;
|
||||
|
||||
Reference in New Issue
Block a user