Code Duplication    Length = 13-13 lines in 3 locations

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

@@ 795-807 (lines=13) @@
792
	/**
793
	 * Set the spoken_languages
794
	 */
795
	public function set_spoken_languages( $data, $id ) {
796
		if ( ! empty( $data[0]['features'] ) && isset( $data[0]['features']['spoken_languages'] ) && ! empty( $data[0]['features']['spoken_languages'] ) ) {
797
			$languages = false;
798
799
			foreach ( $data[0]['features']['spoken_languages'] as $spoken_language ) {
800
				$languages[] = sanitize_title( $spoken_language );
801
			}
802
803
			if ( false !== $languages ) {
804
				$this->save_custom_field( $languages, 'spoken_languages', $id );
805
			}
806
		}
807
	}
808
809
	/**
810
	 * Set the friendly
@@ 812-824 (lines=13) @@
809
	/**
810
	 * Set the friendly
811
	 */
812
	public function set_friendly( $data, $id ) {
813
		if ( ! empty( $data[0]['features'] ) && isset( $data[0]['features']['suggested_visitor_types'] ) && ! empty( $data[0]['features']['suggested_visitor_types'] ) ) {
814
			$friendly_options = false;
815
816
			foreach ( $data[0]['features']['suggested_visitor_types'] as $visitor_type ) {
817
				$friendly_options[] = sanitize_title( $visitor_type );
818
			}
819
820
			if ( false !== $friendly_options ) {
821
				$this->save_custom_field( $friendly_options, 'suggested_visitor_types', $id );
822
			}
823
		}
824
	}
825
826
	/**
827
	 * Set the special interests
@@ 829-841 (lines=13) @@
826
	/**
827
	 * Set the special interests
828
	 */
829
	public function set_special_interests( $data, $id ) {
830
		if ( ! empty( $data[0]['features'] ) && isset( $data[0]['features']['special_interests'] ) && ! empty( $data[0]['features']['special_interests'] ) ) {
831
			$interests = false;
832
833
			foreach ( $data[0]['features']['special_interests'] as $special_interest ) {
834
				$interests[] = sanitize_title( $special_interest );
835
			}
836
837
			if ( false !== $interests ) {
838
				$this->save_custom_field( $interests, 'special_interests', $id );
839
			}
840
		}
841
	}
842
843
	/**
844
	 * Set the Check in and Check out Date