Skip to content

Commit

Permalink
Added discussion_state filter to getThreads
Browse files Browse the repository at this point in the history
Closes #45
  • Loading branch information
Contex committed May 21, 2016
1 parent 3ad2ba8 commit b874c73
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/xenapi/XenAPI/api.php
Expand Up @@ -2531,6 +2531,16 @@ public function processRequest() {
$this->setLimit(10);
$fetch_options = array('limit' => $this->limit);

// Check if request has discussion_state.
if ($this->hasRequest('discussion_state')) {
if (!$this->getRequest('discussion_state')) {
// Throw error if the 'discussion_state ' argument is set but empty.
$this->throwError(1, 'discussion_state');
}
// Add the discussion state to the query conditions.
$conditions['discussion_state'] = $this->getRequest('discussion_state');
}

// Check if request has author.
if ($this->hasRequest('author')) {
if (!$this->getRequest('author')) {
Expand Down

0 comments on commit b874c73

Please sign in to comment.