You are here

public function GetAccount::__construct in SendinBlue 7.2

GetAccount constructor.

File

includes/Model/GetAccount.php, line 32

Class

GetAccount

Code

public function __construct($data = []) {
  $this
    ->setEmail($data['email']);
  $this
    ->setFirstName($data['firstName']);
  $this
    ->setLastName($data['lastName']);
  $this
    ->setCompanyName($data['companyName']);
  if (!empty($data['address'])) {
    $address = new GetExtendedClientAddress($data['address']);
    $this
      ->setAddress($address);
  }
  if (!empty($data['plan'])) {
    foreach ($data['plan'] as $plan) {
      $accountPlan = new GetAccountPlan($plan);
      $this
        ->addPlan($accountPlan);
    }
  }
}