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__)); } }