You are here

public function MailchimpLists::addSegment in Mailchimp 8

Same name in this branch
  1. 8 lib/mailchimp-api-php/src/MailchimpLists.php \Mailchimp\MailchimpLists::addSegment()
  2. 8 lib/mailchimp-api-php/tests/src/MailchimpLists.php \Mailchimp\Tests\MailchimpLists::addSegment()

@inheritdoc

Overrides MailchimpLists::addSegment

File

lib/mailchimp-api-php/tests/src/MailchimpLists.php, line 257

Class

MailchimpLists
Mailchimp Lists library test cases.

Namespace

Mailchimp\Tests

Code

public function addSegment($list_id, $name, $parameters = [], $batch = FALSE) {
  parent::addSegment($list_id, $name, $parameters, $batch);
  $response = (object) [];
  if (!empty($list_id) && !empty($name) && !empty($parameters['type'])) {
    $response->id = 49381;
    $response->name = $name;
    $response->type = $parameters['type'];
    $response->list_id = $list_id;
  }
  return $response;
}