Code Duplication    Length = 13-13 lines in 3 locations

classes/class-wetu-importer-accommodation.php 3 locations

@@ 824-836 (lines=13) @@
821
	/**
822
	 * Set the spoken_languages
823
	 */
824
	public function set_spoken_languages( $data, $id ) {
825
		if ( ! empty( $data[0]['features'] ) && isset( $data[0]['features']['spoken_languages'] ) && ! empty( $data[0]['features']['spoken_languages'] ) ) {
826
			$languages = false;
827
828
			foreach ( $data[0]['features']['spoken_languages'] as $spoken_language ) {
829
				$languages[] = sanitize_title( $spoken_language );
830
			}
831
832
			if ( false !== $languages ) {
833
				$this->save_custom_field( $languages,'spoken_languages',$id );
834
			}
835
		}
836
	}
837
838
	/**
839
	 * Set the friendly
@@ 841-853 (lines=13) @@
838
	/**
839
	 * Set the friendly
840
	 */
841
	public function set_friendly( $data, $id ) {
842
		if ( ! empty( $data[0]['features'] ) && isset( $data[0]['features']['suggested_visitor_types'] ) && ! empty( $data[0]['features']['suggested_visitor_types'] ) ) {
843
			$friendly_options = false;
844
845
			foreach ( $data[0]['features']['suggested_visitor_types'] as $visitor_type ) {
846
				$friendly_options[] = sanitize_title( $visitor_type );
847
			}
848
849
			if ( false !== $friendly_options ) {
850
				$this->save_custom_field( $friendly_options,'suggested_visitor_types',$id );
851
			}
852
		}
853
	}
854
855
	/**
856
	 * Set the special interests
@@ 858-870 (lines=13) @@
855
	/**
856
	 * Set the special interests
857
	 */
858
	public function set_special_interests( $data, $id ) {
859
		if ( ! empty( $data[0]['features'] ) && isset( $data[0]['features']['special_interests'] ) && ! empty( $data[0]['features']['special_interests'] ) ) {
860
			$interests = false;
861
862
			foreach ( $data[0]['features']['special_interests'] as $special_interest ) {
863
				$interests[] = sanitize_title( $special_interest );
864
			}
865
866
			if ( false !== $interests ) {
867
				$this->save_custom_field( $interests,'special_interests',$id );
868
			}
869
		}
870
	}
871
872
	/**
873
	 * Set the Check in and Check out Date