public function __construct(Speakerinvite $invite) { $this->id = $invite->getId(); $this->userId = $invite->getUserId(); $this->lectureId = $invite->getLectureId(); }
private static function insert(Speakerinvite $model) { $db = Db::getInstance(\ConferenceScheduler\Configs\DatabaseConfig::DB_INSTANCE); $query = "INSERT INTO speakerinvites (userId,lectureId) VALUES (:userId, :lectureId);"; $result = $db->prepare($query); $result->execute([':userId' => $model->getUserId(), ':lectureId' => $model->getLectureId()]); $model->setId($db->lastInsertId()); }