GetAccount.php in SendinBlue 8.2
File
src/Tools/Model/GetAccount.php
View source
<?php
namespace Drupal\sendinblue\Tools\Model;
class GetAccount {
public $email;
public $firstName;
public $lastName;
public $companyName;
public $address;
public $plan = [];
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);
}
}
}
public function getEmail() : string {
return $this->email;
}
public function setEmail(string $email) {
$this->email = $email;
}
public function getFirstName() : string {
return $this->firstName;
}
public function setFirstName(string $firstName) {
$this->firstName = $firstName;
}
public function getLastName() : string {
return $this->lastName;
}
public function setLastName(string $lastName) {
$this->lastName = $lastName;
}
public function getCompanyName() : string {
return $this->companyName;
}
public function setCompanyName(string $companyName) {
$this->companyName = $companyName;
}
public function getAddress() : GetExtendedClientAddress {
return $this->address;
}
public function setAddress(GetExtendedClientAddress $address) {
$this->address = $address;
}
public function getPlan() : array {
return $this->plan;
}
public function addPlan(GetAccountPlan $plan) {
$this->plan[] = $plan;
}
}