id = $id; $this->accountId = $accountId; $this->key = $key; $this->value = $value; } /** * @param array $data * * @return GoogleAccountPropertyValue */ public static function fromDbState(array $data): GoogleAccountPropertyValue { if (!isset($data['id'], $data['google_account_id'], $data['varname'], $data['value'])) { throw new InvalidArgumentException('Invalid or incomplete Dataset.'); } return new static($data['id'], $data['google_account_id'], $data['varname'], $data['value']); } /** * @return array */ public function toArray(): array { return [ 'id' => $this->getId(), 'google_account_id' => $this->getAccountId(), 'varname' => $this->getKey(), 'value' => $this->getValue() ]; } /** * @return int|null */ public function getId(): ?int { return $this->id; } /** * @return int|null */ public function getAccountId(): ?int { return $this->accountId; } /** * @return string */ public function getKey(): string { return $this->key; } /** * @return string */ public function getValue(): string { return $this->value; } }