Code Duplication    Length = 11-12 lines in 2 locations

includes/class-wc-order-item.php 2 locations

@@ 215-226 (lines=12) @@
212
	 * Insert data into the database.
213
	 * @since 2.7.0
214
	 */
215
	public function create() {
216
		global $wpdb;
217
218
		$wpdb->insert( $wpdb->prefix . 'woocommerce_order_items', array(
219
			'order_item_name' => $this->get_name(),
220
			'order_item_type' => $this->get_type(),
221
			'order_id'        => $this->get_order_id()
222
		) );
223
		$this->set_id( $wpdb->insert_id );
224
225
		do_action( 'woocommerce_new_order_item', $this->get_id(), $this, $this->get_order_id() );
226
	}
227
228
	/**
229
	 * Update data in the database.
@@ 232-242 (lines=11) @@
229
	 * Update data in the database.
230
	 * @since 2.7.0
231
	 */
232
	public function update() {
233
		global $wpdb;
234
235
		$wpdb->update( $wpdb->prefix . 'woocommerce_order_items', array(
236
			'order_item_name' => $this->get_name(),
237
			'order_item_type' => $this->get_type(),
238
			'order_id'        => $this->get_order_id()
239
		), array( 'order_item_id' => $this->get_id() ) );
240
241
		do_action( 'woocommerce_update_order_item', $this->get_id(), $this, $this->get_order_id() );
242
	}
243
244
	/**
245
	 * Read from the database.