Skip to content

Commit

Permalink
chore: migrate orm deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
smarcet committed Aug 14, 2024
1 parent 2758022 commit 3b7db0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
21 changes: 10 additions & 11 deletions app/Models/Foundation/Summit/Events/SummitEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -1684,25 +1684,24 @@ public function promote2Presentation(PresentationType $type):void{
UPDATE `SummitEvent` SET `ClassName` = 'Presentation', TypeID = :type_id WHERE `SummitEvent`.`ID` = :id;
SQL;

$stmt = $this->prepareRawSQL($sql);
$stmt->execute(
[
'id' => $this->getId(),
'type_id' => $type->getId(),
]
);
$stmt = $this->prepareRawSQL($sql, [
'id' => $this->getId(),
'type_id' => $type->getId(),
]);

$stmt->executeQuery();

$sql = <<<SQL
INSERT INTO `Presentation` (`ID`, `Status`, `OtherTopic`, `Progress`, `Views`, `BeenEmailed`, `ProblemAddressed`, `AttendeesExpectedLearnt`, `Legacy`, `ToRecord`, `AttendingMedia`, `Slug`, `ModeratorID`, `SelectionPlanID`, `WillAllSpeakersAttend`, `DisclaimerAcceptedDate`, `CustomOrder`)
VALUES (:id, NULL, NULL, '0', '0', '0', NULL, NULL, '0', '0', '0', NULL, NULL, NULL, '0', NULL, '0')
SQL;

$stmt = $this->prepareRawSQL($sql);
$stmt->execute(
$stmt = $this->prepareRawSQL($sql,
[
'id' => $this->getId(),
]
);
]);
$stmt->executeQuery();
$this->getEM()->flush();

} catch (\Exception $ex) {

Expand Down
1 change: 1 addition & 0 deletions app/Services/Model/Imp/SummitService.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ private function saveOrUpdateEvent(Summit $summit, array $data, $event_id = null

if (is_null($event))
throw new ValidationException(sprintf("event id %s does not exists!", $event_id));

$old_event_type = $event->getType();

// check event type transition ...
Expand Down

0 comments on commit 3b7db0e

Please sign in to comment.