Site setup fixes
This commit is contained in:
@@ -104,8 +104,25 @@ abstract class ORMOSB extends ORM {
|
||||
$model->$field = serialize($value);
|
||||
}
|
||||
|
||||
public function save(Validation $validation = NULL) {
|
||||
// Find any fields that have changed, and that are blobs, and encode them.
|
||||
if ($this->_changed)
|
||||
foreach ($this->_changed as $c)
|
||||
if ($this->_table_columns[$c]['data_type'] == 'blob')
|
||||
$this->$c = $this->blob($this->$c,TRUE);
|
||||
|
||||
return parent::save($validation);
|
||||
}
|
||||
|
||||
public function changed() {
|
||||
return $this->_changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve and Store DB BLOB data.
|
||||
*/
|
||||
protected function blob($data,$set=FALSE) {
|
||||
return $set ? gzcompress(serialize($data)) : unserialize(gzuncompress($data));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user