OSB Mod: Update to KH ORM for OSB.
This commit is contained in:
parent
6fb7d0035a
commit
ba3c9d60aa
@ -400,6 +400,9 @@ class Kohana_ORM {
|
|||||||
$this->_object[$column] = $value;
|
$this->_object[$column] = $value;
|
||||||
}
|
}
|
||||||
elseif (array_key_exists($column, $this->_object))
|
elseif (array_key_exists($column, $this->_object))
|
||||||
|
{
|
||||||
|
// Only record the change, if the value is actually changed
|
||||||
|
if ($this->_object[$column] !== $value)
|
||||||
{
|
{
|
||||||
$this->_object[$column] = $value;
|
$this->_object[$column] = $value;
|
||||||
|
|
||||||
@ -412,6 +415,7 @@ class Kohana_ORM {
|
|||||||
$this->_saved = FALSE;
|
$this->_saved = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
elseif (isset($this->_belongs_to[$column]))
|
elseif (isset($this->_belongs_to[$column]))
|
||||||
{
|
{
|
||||||
// Update related object itself
|
// Update related object itself
|
||||||
@ -834,9 +838,11 @@ class Kohana_ORM {
|
|||||||
$data[$column] = $this->_object[$column] = ($format === TRUE) ? time() : date($format);
|
$data[$column] = $this->_object[$column] = ($format === TRUE) ? time() : date($format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @todo move this OSB specific site_id processing elsewhere
|
||||||
$query = DB::update($this->_table_name)
|
$query = DB::update($this->_table_name)
|
||||||
->set($data)
|
->set($data)
|
||||||
->where($this->_primary_key, '=', $this->pk())
|
->where($this->_primary_key, '=', $this->pk())
|
||||||
|
->and_where('site_id','=',Config::siteid())
|
||||||
->execute($this->_db);
|
->execute($this->_db);
|
||||||
|
|
||||||
// Object has been saved
|
// Object has been saved
|
||||||
@ -853,6 +859,9 @@ class Kohana_ORM {
|
|||||||
$data[$column] = $this->_object[$column] = ($format === TRUE) ? time() : date($format);
|
$data[$column] = $this->_object[$column] = ($format === TRUE) ? time() : date($format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @todo move this OSB specific site_id processing elsewhere
|
||||||
|
$data['site_id'] = Config::siteid();
|
||||||
|
|
||||||
$result = DB::insert($this->_table_name)
|
$result = DB::insert($this->_table_name)
|
||||||
->columns(array_keys($data))
|
->columns(array_keys($data))
|
||||||
->values(array_values($data))
|
->values(array_values($data))
|
||||||
|
Reference in New Issue
Block a user