getEvent(); DB::query( << $this->type, 'village_id' => $this->event->villageId] ); } public function dbInsert(): void { DB::query( 'insert into events (time, village_id) VALUES (:time, :village_id)', ['time' => $this->event->time->format('c'), 'village_id' => $this->event->villageId] ); DB::query( 'insert into events_upgrade_building (event_id, type) VALUES (:event_id, :type)', ['event_id' => DB::$connection->lastInsertId(), 'type' => $this->type] ); } public function dbDelete(): void { DB::query('delete from events where id=:id', ['id' => $this->eventId]); DB::query('delete from events_upgrade_building where id=:id', ['id' => $this->id]); } }