@param array $w3tc_data Associative array of data to insert. * @param mixed $format Optional. Data format. * * @return mixed Result of the insertion. * * @throws \Exception If insertion fails. */ public function insert( $table, $w3tc_data, $format = null ) { $switched = $this->wpdb_mixin->switch_active_processor( 1 ); try { $w3tc_r = $this->wpdb_mixin->insert( $table, $w3tc_data, $format ); $this->wpdb_mixin->switch_active_processor( -$switched ); return $w3tc_r; } catch ( \Exception $e ) { $this->wpdb_mixin->switch_active_processor( -$switched ); throw $e; } } /** * Replaces a row in a database table. * * @param string $table Name of the table. * @param array $w3tc_data Associative array of data to replace. * @param mixed $format Optional. Data format. * * @return mixed Result of the replacement. * * @throws \Exception If replacement fails. */ public function replace( $table, $w3tc_data, $format = null ) { $switched = $this->wpdb_mixin->switch_active_processor( 1 ); try { $w3tc_r = $this->wpdb_mixin->replace( $table, $w3tc_data, $format ); $this->wpdb_mixin->switch_active_processor( -$switched ); return $w3tc_r; } catch ( \Exception $e ) { $this->wpdb_mixin->switch_active_processor( -$switched ); throw $e; } } /** * Updates rows in a database table. * * @param string $table Name of the table. * @param array $w3tc_data Associative array of data to update. * @param array $where Associative array of conditions for the update. * @param mixed $format Optional. Data format. * @param mixed $where_format Optional. Format for where clause. * * @return mixed Result of the update. * * @throws \Exception If update fails. */ public function update( $table, $w3tc_data, $where, $format = null, $where_format = null ) { $switched = $this->wpdb_mixin->switch_active_processor( 1 ); try { $w3tc_r = $this->wpdb_mixin->update( $table, $w3tc_data, $where, $format, $where_format ); $this->wpdb_mixin->switch_active_processor( -$switched ); return $w3tc_r; } catch ( \Exception $e ) { $this->wpdb_mixin->switch_active_processor( -$switched ); throw $e; } } /** * Deletes rows from a database table. * * @param string $table Name of the table. * @param array $where Associative array of conditions for deletion. * @param mixed $where_format Optional. Format for where clause. * * @return mixed Result of the deletion. * * @throws \Exception If deletion fails. */ public function delete( $table, $where, $where_format = null ) { $switched = $this->wpdb_mixin->switch_active_processor( 1 ); try { $w3tc_r = $this->wpdb_mixin->delete( $table, $where, $where_format ); $this->wpdb_mixin->switch_active_processor( -$switched ); return $w3tc_r; } catch ( \Exception $e ) { $this->wpdb_mixin->switch_active_processor( -$switched ); throw $e; } } }