dba, $this->logger, $this, $data); } /** * {@inheritDoc} * * @return Collection\Notifies */ public function select(array $condition = [], array $params = []) { $params['order'] = $params['order'] ?? ['date' => 'DESC']; return parent::select($condition, $params); } /** * {@inheritDoc} * * @return Model\Notify * @throws NotFoundException */ public function getByID(int $id) { return $this->selectFirst(['id' => $id, 'uid' => local_user()]); } /** * {@inheritDoc} * * @return bool true on success, false on error * @throws Exception */ public function setAllSeen(bool $seen = true) { return $this->dba->update('notify', ['seen' => $seen], ['uid' => local_user()]); } /** * @param array $fields * * @return Model\Notify|false * * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws Exception */ public function insert(array $fields) { $fields['date'] = DateTimeFormat::utcNow(); Hook::callAll('enotify_store', $fields); if (empty($fields)) { $this->logger->debug('Abort adding notification entry'); return false; } $this->logger->debug('adding notification entry', ['fields' => $fields]); return parent::insert($fields); } }