public function update()
{
$allow = true;
$allow = Plugins::filter('block_update_allow', $allow, $this);
if (!$allow) {
return null;
}
Plugins::act('block_update_before', $this);
$this->data = serialize($this->data_values);
$result = parent::updateRecord(DB::table('blocks'), array('id' => $this->id));
$this->fields = array_merge($this->fields, $this->newfields);
$this->newfields = array();
Plugins::act('block_update_after', $this);
return $result;
}