Code Duplication    Length = 12-12 lines in 2 locations

classes/class-wetu-importer-accommodation.php 1 location

@@ 252-263 (lines=12) @@
249
	/**
250
	 * Save the list of Accommodation into an option
251
	 */
252
	public function update_options() {
253
		$data = file_get_contents( $this->url . '/List?' . $this->url_qs );
254
255
		$accommodation = json_decode( $data, true );
256
257
		if ( isset( $accommodation['error'] ) ) {
258
			return $accommodation['error'];
259
		} elseif ( isset( $accommodation ) && ! empty( $accommodation ) ) {
260
			set_transient( 'lsx_ti_accommodation',$accommodation,60 * 60 * 2 );
261
			return true;
262
		}
263
	}
264
265
	/**
266
	 * Run through the accommodation grabbed from the DB.

classes/class-wetu-importer-destination.php 1 location

@@ 746-757 (lines=12) @@
743
	/**
744
	 * Save the list of Accommodation into an option
745
	 */
746
	public function update_options() {
747
		$data = file_get_contents( $this->url . '/List?' . $this->url_qs );
748
749
		$accommodation = json_decode( $data, true );
750
751
		if ( isset( $accommodation['error'] ) ) {
752
			return $accommodation['error'];
753
		} elseif ( isset( $accommodation ) && ! empty( $accommodation ) ) {
754
			set_transient( 'lsx_ti_accommodation',$accommodation,60 * 60 * 2 );
755
			return true;
756
		}
757
	}
758
759
}
760