Code Duplication    Length = 4-5 lines in 2 locations

classes/class-tours.php 2 locations

@@ 680-683 (lines=4) @@
677
	 * Set the price
678
	 */
679
	public function set_price($data,$id) {
680
		if(isset($data['price']) && ''!== $data['price']){
681
            $price = preg_replace("/[^0-9,.]/", "", $data['price']);
682
            $this->save_custom_field($price,'price',$id);
683
		}
684
	}
685
686
	/**
@@ 690-694 (lines=5) @@
687
	 * Set the duration
688
	 */
689
	public function set_duration($data,$id) {
690
		if(isset($data['days']) && !empty($data['days'])){
691
			$price = $data['days'];
692
			$price = preg_replace("/[^0-9,.]/", "", $price);
693
			$this->save_custom_field($price,'duration',$id);
694
		}
695
	}
696
697