Code Duplication    Length = 11-12 lines in 2 locations

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

@@ 199-210 (lines=12) @@
196
	 * Insert data into the database.
197
	 * @since 2.7.0
198
	 */
199
	public function create() {
200
		global $wpdb;
201
202
		$wpdb->insert( $wpdb->prefix . 'woocommerce_order_items', array(
203
			'order_item_name' => $this->get_name(),
204
			'order_item_type' => $this->get_type(),
205
			'order_id'        => $this->get_order_id()
206
		) );
207
		$this->set_id( $wpdb->insert_id );
208
209
		do_action( 'woocommerce_new_order_item', $this->get_id(), $this, $this->get_order_id() );
210
	}
211
212
	/**
213
	 * Update data in the database.
@@ 216-226 (lines=11) @@
213
	 * Update data in the database.
214
	 * @since 2.7.0
215
	 */
216
	public function update() {
217
		global $wpdb;
218
219
		$wpdb->update( $wpdb->prefix . 'woocommerce_order_items', array(
220
			'order_item_name' => $this->get_name(),
221
			'order_item_type' => $this->get_type(),
222
			'order_id'        => $this->get_order_id()
223
		), array( 'order_item_id' => $this->get_id() ) );
224
225
		do_action( 'woocommerce_update_order_item', $this->get_id(), $this, $this->get_order_id() );
226
	}
227
228
	/**
229
	 * Read from the database.