Code Duplication    Length = 11-11 lines in 3 locations

classes/class-accommodation.php 3 locations

@@ 758-768 (lines=11) @@
755
	/**
756
	 * Set the spoken_languages
757
	 */
758
	public function set_spoken_languages($data,$id) {
759
		if(!empty($data[0]['features']) && isset($data[0]['features']['spoken_languages']) && !empty($data[0]['features']['spoken_languages'])){
760
			$languages = false;
761
			foreach($data[0]['features']['spoken_languages'] as $spoken_language){
762
				$languages[] = sanitize_title($spoken_language);
763
			}
764
			if(false !== $languages){
765
				$this->save_custom_field($languages,'spoken_languages',$id);
766
			}
767
		}
768
	}
769
770
	/**
771
	 * Set the friendly
@@ 773-783 (lines=11) @@
770
	/**
771
	 * Set the friendly
772
	 */
773
	public function set_friendly($data,$id) {
774
		if(!empty($data[0]['features']) && isset($data[0]['features']['suggested_visitor_types']) && !empty($data[0]['features']['suggested_visitor_types'])){
775
			$friendly_options = false;
776
			foreach($data[0]['features']['suggested_visitor_types'] as $visitor_type){
777
				$friendly_options[] = sanitize_title($visitor_type);
778
			}
779
			if(false !== $friendly_options){
780
				$this->save_custom_field($friendly_options,'suggested_visitor_types',$id);
781
			}
782
		}		
783
	}
784
785
	/**
786
	 * Set the special interests
@@ 788-798 (lines=11) @@
785
	/**
786
	 * Set the special interests
787
	 */
788
	public function set_special_interests($data,$id) {
789
		if(!empty($data[0]['features']) && isset($data[0]['features']['special_interests']) && !empty($data[0]['features']['special_interests'])){
790
			$interests = false;
791
			foreach($data[0]['features']['special_interests'] as $special_interest){
792
				$interests[] = sanitize_title($special_interest);
793
			}
794
			if(false !== $interests){
795
				$this->save_custom_field($interests,'special_interests',$id);
796
			}
797
		}		
798
	}				
799
800
	/**
801
	 * Set the Check in and Check out Date