Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public function create($email, $name = null)
);
$response = $this->_call('users.json', null, 'POST', $data);

return $response['user'];
return (isset($response['user']) ? $response['user'] : null);
}
}
}
6 changes: 3 additions & 3 deletions src/app/code/community/Zendesk/Zendesk/Model/Api/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ public function recent()
{
$response = $this->_call('tickets/recent.json', array('include' => 'users,groups'));

return $response['tickets'];
return (isset($response['tickets']) ? $response['tickets'] : null);
}

public function all()
{
$response = $this->_call('tickets.json', array('include' => 'users,groups'));
return $response['tickets'];
return (isset($response['tickets']) ? $response['tickets'] : null);
}

public function search($data)
Expand Down Expand Up @@ -189,7 +189,7 @@ public function create($data)
{
$response = $this->_call('tickets.json', null, 'POST', $data);

return $response['ticket'];
return (isset($response['ticket']) ? $response['ticket'] : null);
}

}
16 changes: 8 additions & 8 deletions src/app/code/community/Zendesk/Zendesk/Model/Api/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function me()
{
$response = $this->_call('users/me.json');

return $response['user'];
return (isset($response['user']) ? $response['user'] : null);
}

public function get($id)
Expand All @@ -48,7 +48,7 @@ public function get($id)

$response = $this->_call('users/' . $id . '.json');

return $response['user'];
return (isset($response['user']) ? $response['user'] : null);
}

public function all()
Expand All @@ -72,37 +72,37 @@ public function end($id)

$response = $this->_call('end_users/'. $id .'.json');

return $response['user'];
return (isset($response['user']) ? $response['user'] : null);
}

public function getIdentities($id)
{
$response = $this->_call('users/' . $id . '/identities.json');
return $response['identities'];
return (isset($response['identities']) ? $response['identities'] : null);
}

public function setPrimaryIdentity($user_id, $identity_id)
{
$response = $this->_call('users/' . $user_id . '/identities/'.$identity_id.'/make_primary.json', null, 'PUT', null, true);
return $response['identities'];
return (isset($response['identities']) ? $response['identities'] : null);
}

public function addIdentity($user_id, $data)
{
$response = $this->_call('users/' . $user_id . '/identities.json', null, 'POST', $data, true);
return $response['identity'];
return (isset($response['identity']) ? $response['identity'] : null);
}

public function update($user_id, $user)
{
$response = $this->_call('users/' . $user_id . '.json', null, 'PUT', $user, true);
return $response['user'];
return (isset($response['user']) ? $response['user'] : null);
}

public function create($user)
{
$response = $this->_call('users.json', null, 'POST', $user, true);
return $response['user'];
return (isset($response['user']) ? $response['user'] : null);
}

public function createUserField($field)
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Zendesk/Zendesk/Model/Api/Views.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Zendesk_Zendesk_Model_Api_Views extends Zendesk_Zendesk_Model_Api_Abstract
public function active()
{
$response = $this->_call('views/active.json');
return $response['views'];
return (isset($response['views']) ? $response['views'] : null);
}

public function get($id)
Expand All @@ -30,7 +30,7 @@ public function get($id)
}

$response = $this->_call('views/' . $id . '.json');
return $response['view'];
return (isset($response['view']) ? $response['view'] : null);
}

public function execute($id, array $params = array())
Expand Down