Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Allow Deleting of List if they only have 1 list left / Make sure the Products stay within the array #18

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion src/Bronto/Api/Contact/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,15 @@ public function removeFromList($list)
}
}
}

if(empty($this->_data['listIds']) === true)
{
$this->_data['listIds'][] = null;
}

// Bronto requires it to be in seq order
$this->_data['listIds'] = array_values($this->_data['listIds']);
$this->_modifiedFields['listIds'] = true;

return $this;
}

Expand Down
5 changes: 5 additions & 0 deletions src/Bronto/Api/Order/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public function __set($columnName, $value)
*/
public function addProduct(array $data = array())
{
if(empty($this->products) === true)
{
$this->products = array();
}

$product = new Bronto_Api_Order_Product($data);
$productId = $product->id;

Expand Down