@@ 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 |
|
@@ 418-429 (lines=12) @@ | ||
415 | * @param array $ad_groups List of groups that should not see this ad |
|
416 | * @return void |
|
417 | */ |
|
418 | protected function insert_ad_group_data($ad_id, $ad_groups) |
|
419 | { |
|
420 | $sql_ary = array(); |
|
421 | foreach ($ad_groups as $group) |
|
422 | { |
|
423 | $sql_ary[] = array( |
|
424 | 'ad_id' => $ad_id, |
|
425 | 'group_id' => $group, |
|
426 | ); |
|
427 | } |
|
428 | $this->db->sql_multi_insert($this->ad_group_table, $sql_ary); |
|
429 | } |
|
430 | ||
431 | /** |
|
432 | * Remove all rows of specified ad in ad_group table |