id = (int) ($row['id'] ?? 0); $model->cardId = (int) ($row['card_id'] ?? 0); $model->fromColumnId = isset($row['from_column_id']) ? (int) $row['from_column_id'] : null; $model->fromColumnName = $row['from_column_name'] ?? null; $model->toColumnId = (int) ($row['to_column_id'] ?? 0); $model->toColumnName = $row['to_column_name'] ?? null; $model->fromSwimLaneId = isset($row['from_swim_lane_id']) ? (int) $row['from_swim_lane_id'] : null; $model->fromSwimLaneName = $row['from_swim_lane_name'] ?? null; $model->toSwimLaneId = (int) ($row['to_swim_lane_id'] ?? 0); $model->toSwimLaneName = $row['to_swim_lane_name'] ?? null; $model->movedAt = (string) ($row['moved_at'] ?? ''); $model->movedBy = (string) ($row['moved_by'] ?? ''); return $model; } public function toJsonArray(): array { return [ 'id' => $this->id, 'from_column_id' => $this->fromColumnId, 'from_column_name' => $this->fromColumnName, 'to_column_id' => $this->toColumnId, 'to_column_name' => $this->toColumnName, 'from_swim_lane_id' => $this->fromSwimLaneId, 'from_swim_lane_name' => $this->fromSwimLaneName, 'to_swim_lane_id' => $this->toSwimLaneId, 'to_swim_lane_name' => $this->toSwimLaneName, 'moved_at' => $this->movedAt, 'moved_by' => $this->movedBy, ]; } }