Code Duplication    Length = 12-12 lines in 2 locations

ad/manager.php 2 locations

@@ 289-300 (lines=12) @@
286
	 * @param	array	$ad_locations	List of template locations for this ad
287
	 * @return	void
288
	 */
289
	public function insert_ad_locations($ad_id, $ad_locations)
290
	{
291
		$sql_ary = array();
292
		foreach ($ad_locations as $ad_location)
293
		{
294
			$sql_ary[] = array(
295
				'ad_id'			=> $ad_id,
296
				'location_id'	=> $ad_location,
297
			);
298
		}
299
		$this->db->sql_multi_insert($this->ad_locations_table, $sql_ary);
300
	}
301
302
	/**
303
	 * Delete advertisement locations
@@ 415-426 (lines=12) @@
412
	 * @param array $ad_groups List of groups that should not see this ad
413
	 * @return void
414
	 */
415
	protected function insert_ad_group_data($ad_id, $ad_groups)
416
	{
417
		$sql_ary = array();
418
		foreach ($ad_groups as $group)
419
		{
420
			$sql_ary[] = array(
421
				'ad_id'		=> $ad_id,
422
				'group_id'	=> $group,
423
			);
424
		}
425
		$this->db->sql_multi_insert($this->ad_group_table, $sql_ary);
426
	}
427
}
428