false,'error'=>'missing_id']; $all = self::all(); $flow['id'] = $id; if (!isset($flow['enabled'])) $flow['enabled'] = true; $all[$id] = $flow; update_option(self::OPTION_KEY, $all, false); return ['ok'=>true,'flow'=>$flow]; } public static function delete($id) { $id = trim((string)$id); if ($id === '') return ['ok'=>false,'error'=>'missing_id']; $all = self::all(); unset($all[$id]); update_option(self::OPTION_KEY, $all, false); return ['ok'=>true]; } }