id = (int)$queryObject->id; $self->title = $queryObject->title; $self->createdAt = Temporal::toDateTime($queryObject->createdAt); $self->updatedAt = Temporal::toDateTime($queryObject->updatedAt); $self->status = new DonationFormStatus($queryObject->status); $self->settings = json_decode($queryObject->{DonationFormMetaKeys::SETTINGS()->getKeyAsCamelCase()}, true); $self->blocks = BlockCollection::fromJson($queryObject->blocks); return $self; } /** * Convert DTO to Donation Form * * @return DonationForm */ public function toDonationForm(): DonationForm { $attributes = get_object_vars($this); return new DonationForm($attributes); } }