Code Duplication    Length = 11-11 lines in 3 locations

classes/class-accommodation.php 3 locations

@@ 744-754 (lines=11) @@
741
	/**
742
	 * Set the spoken_languages
743
	 */
744
	public function set_spoken_languages($data,$id) {
745
		if(!empty($data[0]['features']) && isset($data[0]['features']['spoken_languages']) && !empty($data[0]['features']['spoken_languages'])){
746
			$languages = false;
747
			foreach($data[0]['features']['spoken_languages'] as $spoken_language){
748
				$languages[] = sanitize_title($spoken_language);
749
			}
750
			if(false !== $languages){
751
				$this->save_custom_field($languages,'spoken_languages',$id);
752
			}
753
		}
754
	}
755
756
	/**
757
	 * Set the friendly
@@ 759-769 (lines=11) @@
756
	/**
757
	 * Set the friendly
758
	 */
759
	public function set_friendly($data,$id) {
760
		if(!empty($data[0]['features']) && isset($data[0]['features']['suggested_visitor_types']) && !empty($data[0]['features']['suggested_visitor_types'])){
761
			$friendly_options = false;
762
			foreach($data[0]['features']['suggested_visitor_types'] as $visitor_type){
763
				$friendly_options[] = sanitize_title($visitor_type);
764
			}
765
			if(false !== $friendly_options){
766
				$this->save_custom_field($friendly_options,'suggested_visitor_types',$id);
767
			}
768
		}		
769
	}
770
771
	/**
772
	 * Set the special interests
@@ 774-784 (lines=11) @@
771
	/**
772
	 * Set the special interests
773
	 */
774
	public function set_special_interests($data,$id) {
775
		if(!empty($data[0]['features']) && isset($data[0]['features']['special_interests']) && !empty($data[0]['features']['special_interests'])){
776
			$interests = false;
777
			foreach($data[0]['features']['special_interests'] as $special_interest){
778
				$interests[] = sanitize_title($special_interest);
779
			}
780
			if(false !== $interests){
781
				$this->save_custom_field($interests,'special_interests',$id);
782
			}
783
		}		
784
	}				
785
786
	/**
787
	 * Set the Check in and Check out Date