function __construct(Notification $notification) { $this->id = $notification->getId(); $this->content = $notification->getContent(); $this->isRead = $notification->getIsRead(); $this->createdOn = $notification->getCreatedOn(); }
private static function update(Notification $model) { $db = DatabaseData::getInstance(\RedDevil\Config\DatabaseConfig::DB_INSTANCE); $query = "UPDATE notifications SET Content= :Content, UserId= :UserId, IsRead= :IsRead, CreatedOn= :CreatedOn WHERE id = :id"; $result = $db->prepare($query); $result->execute([':id' => $model->getId(), ':Content' => $model->getContent(), ':UserId' => $model->getUserId(), ':IsRead' => $model->getIsRead(), ':CreatedOn' => $model->getCreatedOn()]); }