Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Add Upsert support by implementing put method on DataExtension Row #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/ET_DataExtension_Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,30 @@ public function patch()
$this->props = $originalProps;
return $response;
}


/**
* Put this instance.
* @return ET_Patch Object of type ET_Patch which contains http status code, response, etc from the PATCH SOAP service
*/
public function put()
{
$this->getCustomerKey();
$originalProps = $this->props;
$overrideProps = array();
$fields = array();

foreach ($this->props as $key => $value){
$fields[] = array("Name" => $key, "Value" => $value);
}
$overrideProps['CustomerKey'] = $this->CustomerKey;
$overrideProps['Properties'] = array("Property"=> $fields);

$this->props = $overrideProps;
$response = parent::put();
$this->props = $originalProps;
return $response;
}

/**
* Delete this instance.
* @return ET_Delete Object of type ET_Delete which contains http status code, response, etc from the DELETE SOAP service
Expand Down Expand Up @@ -151,4 +174,4 @@ private function getCustomerKey()
}
}
}
?>
?>