function cc::get_campaign in Constant Contact 7.3
Same name and namespace in other branches
- 6.3 class.cc.php \cc::get_campaign()
- 6.2 class.cc.php \cc::get_campaign()
Gets an individual campaign.
@access public
File
- ./
class.cc.php, line 1266 - Constant Contact PHP Class
Class
- cc
- @file Constant Contact PHP Class
Code
function get_campaign($id) {
$xml = $this
->load_url("campaigns/{$id}");
if (!$xml) {
return FALSE;
}
// Parse into nicer array.
$campaign = FALSE;
$_campaign = isset($xml['entry']) ? $xml['entry'] : FALSE;
// Parse into nicer array.
if (is_array($_campaign)) {
$id = $this
->get_id_from_link($_campaign['link_attr']['href']);
$campaign = $_campaign['content']['Campaign'];
$campaign['id'] = $id;
}
return $campaign;
}