You are here

public function GetAccountPlan::__construct in SendinBlue 8

Same name and namespace in other branches
  1. 8.2 src/Tools/Model/GetAccountPlan.php \Drupal\sendinblue\Tools\Model\GetAccountPlan::__construct()

GetAccount constructor.

File

src/Tools/Model/GetAccountPlan.php, line 34

Class

GetAccountPlan

Namespace

Drupal\sendinblue\Tools\Model

Code

public function __construct(array $data = []) {
  $this
    ->setType($data['type']);
  $this
    ->setCreditsType($data['creditsType']);
  $this
    ->setCredits($data['credits']);
  if (!empty($data['startDate'])) {
    $this
      ->setStartDate(new \DateTime($data['startDate']));
  }
  if (!empty($data['endDate'])) {
    $this
      ->setEndDate(new \DateTime($data['endDate']));
  }
  if (!empty($data['userLimit'])) {
    $this
      ->setUserLimit($data['userLimit']);
  }
}