Initial survey bundle import

This commit is contained in:
Jürgen Mummert
2026-05-17 17:31:28 +02:00
commit b8475e3a57
84 changed files with 7157 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Mummert\SurveyBundle\Form\Model;
use Mummert\SurveyBundle\Model\SurveyModel;
final class SurveyEditorData
{
public string $title = '';
public string $description = '';
public bool $published = false;
public static function fromModel(SurveyModel $survey): self
{
$data = new self();
$data->title = (string) $survey->title;
$data->description = (string) $survey->description;
$data->published = '1' === (string) $survey->published;
return $data;
}
/**
* @return array<string, mixed>
*/
public function toArray(): array
{
return [
'title' => $this->title,
'description' => $this->description,
'published' => $this->published,
];
}
}