public function GetAccount::__construct in SendinBlue 8
Same name and namespace in other branches
- 8.2 src/Tools/Model/GetAccount.php \Drupal\sendinblue\Tools\Model\GetAccount::__construct()
GetAccount constructor.
File
- src/
Tools/ Model/ GetAccount.php, line 34
Class
Namespace
Drupal\sendinblue\Tools\ModelCode
public function __construct(array $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);
}
}
}