public function update()
{
try {
$type = get_object_vars($this->model);
foreach ($type as $key => $value) {
if (in_array($key, $this->getValidTableColumns(self::TABLE_NAME_RELATIONS))) {
if (is_bool($value)) {
$value = (int) $value;
}
if (is_array($value) || is_object($value)) {
$value = \Pimcore\Tool\Serialize::serialize($value);
}
$data[$key] = $value;
}
}
$this->db->insertOrUpdate(self::TABLE_NAME_RELATIONS, $data);
return $this->model;
} catch (\Exception $e) {
throw $e;
}
}