/** * Insert all objects from list to databas * * @param vivvo_post_master $post_master * @param array $params Params to change assoc array * @param array $restiction Restriction ids * * @return bool succes */ function sql_update_list($post_master, $params, $restriction = NULL, $all_matching = false) { $result = true; $ids = $this->get_list_ids(true); if ($ids && is_array($restriction) && !empty($restriction)) { $ids = array_intersect($ids, $restriction); } if ($ids) { $db = $this->get_db(); foreach ($ids as $id) { $where[] = $db->quote($id); } $where = $this->id_key . ' IN (' . implode(',', $where) . ')'; $result = $post_master->sql_update_list(VIVVO_DB_PREFIX . $this->_sql_table, $params, $where); } elseif ($all_matching === true) { $where = str_replace('WHERE', ' ', $this->_query->get_where()); $from = str_replace('FROM', ' ', $this->_query->get_from()); $result = $post_master->sql_update_list(VIVVO_DB_PREFIX . $this->_sql_table, $params, $where, $from); } return $result; }