Skip to content

Commit

Permalink
Merge f6b0f4f into 43fb5a6
Browse files Browse the repository at this point in the history
  • Loading branch information
silverman63 committed Aug 16, 2017
2 parents 43fb5a6 + f6b0f4f commit 9447e3f
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions sailthru/Sailthru_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,20 @@ public function saveInclude($include_name, array $include_fields = [ ]) {
* Get information about a list.
*
* @param string $list
* @param bool $get_vars
* @return array
* @link http://docs.sailthru.com/api/list
*/
public function getList($list) {
return $this->apiGet('list', [ 'list' => $list ]);
public function getList($list, $get_vars = false) {
$data = [
'list' => $list
];
if ($get_vars) {
$data['fields'] = [
'vars' => 1
];
}
return $this->apiGet('list', $data);
}

/**
Expand All @@ -495,18 +504,22 @@ public function getLists() {
* @param string $type
* @param bool $primary
* @param array $query
* @param array $vars
* @return array
* @link http://docs.sailthru.com/api/list
* @link http://docs.sailthru.com/api/query
*/
public function saveList($list, $type = null, $primary = null, $query = [ ], $vars = []) {
public function saveList($list, $type = null, $primary = null, $query = [ ], $vars = [ ]) {
$data = [
'list' => $list,
'type' => $type,
'primary' => $primary ? 1 : 0,
'query' => $query,
'vars' => $vars,
'vars' => $vars
];
if ($vars) {
$data['vars'] = $vars;
}
return $this->apiPost('list', $data);
}

Expand Down

0 comments on commit 9447e3f

Please sign in to comment.