Skip to content
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
21 changes: 20 additions & 1 deletion Trello/Model/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ public function get(){

}

/**
* Delete an item by id ($this->id)
*
* @throws \InvalidArgumentException
* @return \Trello\Model\Object
*/
public function delete(){

if (!$this->getId()){
throw new \InvalidArgumentException('There is no ID set for this object - Please call setId before calling get');
}

$child = get_class($this);
$response = $this->getClient()->delete($this->getModel() . '/' . $this->getId());

return true;

}

/**
* Get relative data
*
Expand Down Expand Up @@ -207,4 +226,4 @@ public function valid(){

}

}
}