123456789101112131415161718192021222324 |
- <?php
- namespace DNB;
- class Questionaire extends AbstractPostSerializable implements PostSerializableInterface {
- public function __construct(
- private ?bool $keepMeInformedOnBids = null,
- private ?bool $contactForPropertyValuation = null,
- private ?bool $contactForEconomicalAdvice = null,
- ){}
- public function toPostParams(): array {
- $arr = [];
- foreach (static::getClassVars() as $key)
- $arr[$key] = !is_null($this->{$key}) ? $this->{$key} : false;
- return $arr;
- }
- protected static function getClassVars(): array {
- return array_keys(get_class_vars(__CLASS__));
- }
- }
|