Code Duplication    Length = 10-10 lines in 2 locations

includes/abstracts/abstract-wc-order.php 1 location

@@ 363-372 (lines=10) @@
360
	 * @param  string $value
361
	 * @param  int $meta_id
362
	 */
363
	public function update_meta_data( $key, $value, $meta_id = '' ) {
364
		if ( $meta_id && isset( $this->_meta_data[ $meta_id ] ) ) {
365
			$this->_meta_data[ $meta_id ] = (object) array(
366
				'key'   => $key,
367
				'value' => $value,
368
			);
369
		} else {
370
			$this->add_meta_data( $key, $value, true );
371
		}
372
	}
373
374
	/**
375
	 * Read Meta Data from the database. Ignore any internal properties.

includes/class-wc-order-item.php 1 location

@@ 414-423 (lines=10) @@
411
	 * @param  string $value
412
	 * @param  int $meta_id
413
	 */
414
	public function update_meta_data( $key, $value, $meta_id = '' ) {
415
		if ( $meta_id && isset( $this->_meta_data[ $meta_id ] ) ) {
416
			$this->_meta_data[ $meta_id ] = (object) array(
417
				'key'   => $key,
418
				'value' => $value
419
			);
420
		} else {
421
			$this->add_meta_data( $key, $value, true );
422
		}
423
	}
424
425
	/**
426
	 * Read Meta Data from the database. Ignore any internal properties.