123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace DNB;
- class Questionaire extends AbstractPostSerializable implements PostSerializableInterface {
- private ?bool $keepMeInformedOnBids;
- private ?bool $contactForPropertyValuation;
- private ?bool $contactForEconomicalAdvice;
- public function __construct(
- ?bool $keepMeInformedOnBids = null,
- ?bool $contactForPropertyValuation = null,
- ?bool $contactForEconomicalAdvice = null
- ){
- $this->keepMeInformedOnBids = $keepMeInformedOnBids;
- $this->contactForPropertyValuation = $contactForPropertyValuation;
- $this->contactForEconomicalAdvice = $contactForEconomicalAdvice;
- }
- 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__));
- }
- }
|