1, 'days' => ['monday', 'wednesday', 'friday']] )] public ?array $recurrenceDetails = null; #[Groups(['command-task-schedule:write'])] #[ApiProperty( description: 'Si la programación está habilitada', example: true )] public ?bool $enabled = null; public function __construct(?CommandTaskSchedule $commandTaskSchedule = null) { if (!$commandTaskSchedule) { return; } $this->commandTask = new CommandTaskOutput($commandTaskSchedule->getCommandTask()); $this->recurrenceType = $commandTaskSchedule->getRecurrenceType(); $this->executionDate = $commandTaskSchedule->getExecutionDate(); $this->executionTime = $commandTaskSchedule->getExecutionTime(); $this->recurrenceDetails = $commandTaskSchedule->getRecurrenceDetails(); $this->enabled = $commandTaskSchedule->isEnabled(); } /** * @throws \Exception */ public function createOrUpdateEntity(?CommandTaskSchedule $commandTaskSchedule = null): CommandTaskSchedule { if (!$commandTaskSchedule) { $commandTaskSchedule = new CommandTaskSchedule(); } if ($this->commandTask) { $commandTaskSchedule->setCommandTask($this->commandTask->getEntity()); } $commandTaskSchedule->setRecurrenceType($this->recurrenceType); $commandTaskSchedule->setExecutionTime($this->executionTime); $commandTaskSchedule->setExecutionDate($this->executionDate); $commandTaskSchedule->setRecurrenceDetails($this->recurrenceDetails); $commandTaskSchedule->setEnabled($this->enabled); return $commandTaskSchedule; } }