Code Duplication    Length = 11-12 lines in 2 locations

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

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