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