| @@ 294-305 (lines=12) @@ | ||
| 291 | * @param array $ad_locations List of template locations for this ad |
|
| 292 | * @return void |
|
| 293 | */ |
|
| 294 | public function insert_ad_locations($ad_id, $ad_locations) |
|
| 295 | { |
|
| 296 | $sql_ary = array(); |
|
| 297 | foreach ($ad_locations as $ad_location) |
|
| 298 | { |
|
| 299 | $sql_ary[] = array( |
|
| 300 | 'ad_id' => $ad_id, |
|
| 301 | 'location_id' => $ad_location, |
|
| 302 | ); |
|
| 303 | } |
|
| 304 | $this->db->sql_multi_insert($this->ad_locations_table, $sql_ary); |
|
| 305 | } |
|
| 306 | ||
| 307 | /** |
|
| 308 | * Delete advertisement locations |
|
| @@ 423-434 (lines=12) @@ | ||
| 420 | * @param array $ad_groups List of groups that should not see this ad |
|
| 421 | * @return void |
|
| 422 | */ |
|
| 423 | protected function insert_ad_group_data($ad_id, $ad_groups) |
|
| 424 | { |
|
| 425 | $sql_ary = array(); |
|
| 426 | foreach ($ad_groups as $group) |
|
| 427 | { |
|
| 428 | $sql_ary[] = array( |
|
| 429 | 'ad_id' => $ad_id, |
|
| 430 | 'group_id' => $group, |
|
| 431 | ); |
|
| 432 | } |
|
| 433 | $this->db->sql_multi_insert($this->ad_group_table, $sql_ary); |
|
| 434 | } |
|
| 435 | ||
| 436 | /** |
|
| 437 | * Remove all rows of specified ad in ad_group table |
|