function CreateContentAreas($arrayOfContentAreas) { $postC = new ET_ContentArea(); $postC->authStub = $this; $postC->props = $arrayOfContentAreas; $sendResponse = $postC->post(); return $sendResponse; }
print_r($response->results); print "\n---------------\n"; print_r(">>> Delete contAreaOne\n"); $contArea = new ET_ContentArea(); $contArea->authStub = $myclient; $contArea->props = array("CustomerKey" => $NameOfContentAreaOne); $delResponse = $contArea->delete(); print_r('Delete Status: ' . ($delResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $delResponse->code . "\n"; print 'Message: ' . $delResponse->message . "\n"; print 'Result Count: ' . count($delResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($delResponse->results); print "\n---------------\n"; print_r(">>> Delete contAreaTwo\n"); $contArea = new ET_ContentArea(); $contArea->authStub = $myclient; $contArea->props = array("CustomerKey" => $NameOfContentAreaTwo); $delResponse = $contArea->delete(); print_r('Delete Status: ' . ($delResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $delResponse->code . "\n"; print 'Message: ' . $delResponse->message . "\n"; print 'Result Count: ' . count($delResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($delResponse->results); print "\n---------------\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } ?>
// Delete ContentArea print "Delete ContentArea \n"; $deleteContent = new ET_ContentArea(); $deleteContent->authStub = $myclient; $deleteContent->props = array("CustomerKey" => $NameOfTestContentArea); $deleteResponse = $deleteContent->delete(); print_r('Delete Status: ' . ($deleteResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $deleteResponse->code . "\n"; print 'Message: ' . $deleteResponse->message . "\n"; print 'Results Length: ' . count($deleteResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($deleteResponse->results); print "\n---------------\n"; // Retrieve ContentArea to confirm deletion print "Retrieve ContentArea to confirm deletion \n"; $getContent = new ET_ContentArea(); $getContent->authStub = $myclient; $getContent->filter = array('Property' => 'CustomerKey', 'SimpleOperator' => 'equals', 'Value' => $NameOfTestContentArea); $getContent->props = array("RowObjectID", "ObjectID", "ID", "CustomerKey", "Client.ID", "ModifiedDate", "CreatedDate", "CategoryID", "Name", "Layout", "IsDynamicContent", "Content", "IsSurvey", "IsBlank", "Key"); $getResponse = $getContent->get(); print_r('Get Status: ' . ($getResponse->status ? 'true' : 'false') . "\n"); print 'Code: ' . $getResponse->code . "\n"; print 'Message: ' . $getResponse->message . "\n"; print_r('More Results: ' . ($getResponse->moreResults ? 'true' : 'false') . "\n"); print 'Results Length: ' . count($getResponse->results) . "\n"; print 'Results: ' . "\n"; print_r($getResponse->results); print "\n---------------\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; }