Mark the notification as read.

@return void
168077
public function markAsRead()
    {
        if (is_null($this->read_at)) {
            $this->forceFill(array(
                'read_at' => $this->freshTimestamp()
            ));

            $this->save();
        }
    }
100436
public function read($id, ReadNotificationRequest $request)
    {
        $user = $request->user();
        $item = $user->notifications()->find($id);
        if (empty($item)) {
            return $this->sendError('Notification not found');
        }
        $item->markAsRead();

        return $this->sendResponse($item, '');
    }
1077190
public function markAsRead($notifications = null)
    {
        // If we don't pass notifications, mark all as read for the current logged in user
        $user = Craft::$app->getUser();
        if ($user && is_null($notifications)) {
            $notifications = NotificationsRecord::find()->where(['notifiable' => $user->getId()])->all();
        }

        // Make sure we have a collection to loop over
        $notifications = collect($notifications);

        $notificationIds = $notifications->map(function ($notification) {
            return is_object($notification) ? $notification->id : $notification;
        });

        // Update the read notifications
        if (! is_null($notificationIds)) {
            $now = DateTimeHelper::currentUTCDateTime()->format('Y-m-d H:i:s');
            NotificationsRecord::updateAll(['read_at' => $now], ['id' => $notificationIds]);
        }
    }
1277617
public function notify()
    {
        \BFW\Application::getInstance()
            ->getMonolog()
            ->getLogger()
            ->debug(
                'Subject notify event',
                ['action' => $this->action]
            );
        
        foreach ($this->observers as $observer) {
            $observer->update($this);
        }
    }
1098043
public function markReadOnly(): void
    {
        $this->readOnly = true;

        /** @var Config $value */
        foreach ($this->data as $value) {
            if ($value instanceof self) {
                $value->markReadOnly();
            }
        }
    }
210019
public function markAsRead(array $notifications)
    {
        $ids = $this->getIds($notifications);

        $this->whereIn($this->getKeyName(), $ids)->update(['read' => true, 'read_at' => new Carbon()]);

        return $this->whereIn($this->getKeyName(), $ids)->get()->all();
    }
149109
protected function getNotification()
    {
        if ($header = $this->read()) {
            $header = $this->parseData($header);

            $payload = $this->read($header['len']);
            $payload = explode("\n", $payload, 2);
            isset($payload[1]) or $payload[1] = null;

            list($payload, $body) = $payload;

            $payload = $this->parseData($payload);

            return new Notification($header, $payload, $body);
        }
    }
724335
protected function onRead()
    {
        if (!empty($this->boundary)) {
            $this->req->attrs->input->parseMultipart();
        }
        if (($this->req->attrs->contentLength <= $this->readed) && !$this->EOF) {
            $this->sendEOF();
        }
    }
8707
protected function onRead()
    {
        start:
        if ($this->state === static::STATE_STANDBY) {
            if (($hdr = $this->readExact(2)) === false) {
                return; // not enough data
            }

            $u = unpack('S', $hdr);
            $this->responseCode = $u[1];
            $this->state = static::STATE_PACKET_HDR;
        }
        if ($this->state === static::STATE_PACKET_HDR) {
            if ($this->responseCode === static::REPL_KVAL) {
                $this->result = [];
                if (($hdr = $this->readExact(9)) === false) {
                    return; // not enough data
                }
                $this->encoding = Binary::getByte($hdr);
                $this->responseLength = Binary::getDword($hdr, true) - 4;
                $this->totalNum = Binary::getDword($hdr, true);
                $this->readedNum = 0;
                $this->state = static::STATE_PACKET_DATA;
            } else {
                if (($hdr = $this->lookExact(5)) === false) {
                    return; // not enough data
                }
                $this->encoding = Binary::getByte($hdr);
                $pl = Binary::getDword($hdr, true);
                if ($this->getInputLength() < 5 + $pl) {
                    return; // not enough data
                }
                $this->drain(5);
                $this->responseLength = $pl;
                if ($this->responseLength > $this->pool->maxAllowedPacket) {
                    $this->log('max-allowed-packet (' . $this->pool->config->maxallowedpacket->getHumanValue() . ') exceed, aborting connection');
                    $this->finish();
                    return;
                }
                if ($this->responseCode === static::REPL_ERR_NOT_FOUND) {
                    $this->drain($this->responseLength);
                    $this->result = null;
                    $this->isFinal = true;
                    $this->totalNum = 0;
                    $this->readedNum = 0;
                    $this->executeCb();
                } elseif ($this->responseCode === static::REPL_OK) {
                    $this->drain($this->responseLength);
                    $this->result = true;
                    $this->isFinal = true;
                    $this->totalNum = 0;
                    $this->readedNum = 0;
                    $this->executeCb();
                } elseif (($this->responseCode === static::REPL_ERR_MEM) ||
                    ($this->responseCode === static::REPL_ERR_NAN) ||
                    ($this->responseCode === static::REPL_ERR_LOCKED)
                ) {
                    $this->drain($this->responseLength);
                    $this->result = false;
                    $this->isFinal = true;
                    $this->totalNum = 0;
                    $this->readedNum = 0;
                    $this->executeCb();
                } else {
                    if ($this->responseCode === static::REPL_KVAL && $this->totalNum <= 0) {
                        $this->drain($this->responseLength);
                        $this->isFinal = true;
                        $this->totalNum = 0;
                        $this->readedNum = 0;
                        $this->result = [];
                        $this->executeCb();
                    } else {
                        $this->state = static::STATE_PACKET_DATA;
                    }
                }
            }
        }
        if ($this->state === static::STATE_PACKET_DATA) {
            if ($this->responseCode === static::REPL_KVAL) {
                $keyAdded = false;
                nextElement:
                $l = $this->getInputLength();
                if ($l < 9) {
                    goto cursorCall;
                }
                if (($hdr = $this->lookExact($o = 4)) === false) {
                    goto cursorCall;
                }
                $keyLen = Binary::getDword($hdr, true);
                if (($key = $this->lookExact($keyLen, $o)) === false) {
                    goto cursorCall;
                }
                $o += $keyLen;
                if (($encoding = $this->lookExact(1, $o)) === false) {
                    goto cursorCall;
                }
                $encoding = ord($encoding);
                ++$o;
                if (($hdr = $this->lookExact(4, $o)) === false) {
                    goto cursorCall;
                }
                $o += 4;
                $valLen = Binary::getDword($hdr, true);
                if ($o + $valLen > $l) {
                    goto cursorCall;
                }
                $this->drain($o);
                if ($encoding === static::GB_ENC_NUMBER) {
                    $val = $this->read($valLen);
                    $this->result[$key] = $valLen === 8
                        ? Binary::getQword($val, true)
                        : Binary::getDword($val, true);
                } else {
                    $this->result[$key] = $this->read($valLen);
                }
                $keyAdded = true;
                if (++$this->readedNum >= $this->totalNum) {
                    $this->isFinal = true;
                    $this->executeCb();
                    goto start;
                } else {
                    goto nextElement;
                }
                cursorCall:
                if ($keyAdded) {
                    $this->onResponse->executeAndKeepOne($this);
                }
                return;
            } else {
                if (($this->result = $this->readExact($this->responseLength)) === false) {
                    $this->setWatermark($this->responseLength);
                    return;
                }
                $this->setWatermark(2, $this->pool->maxAllowedPacket);
                if ($this->encoding === static::GB_ENC_NUMBER) {
                    $this->result = $this->responseLength === 8
                        ? Binary::getQword($this->result, true)
                        : Binary::getDword($this->result, true);
                }
                $this->isFinal = true;
                $this->totalNum = 1;
                $this->readedNum = 1;
                $this->executeCb();
            }
        }
        goto start;
    }
27318
public function mark_pm_read($messageId)
    {
        try {
            $manager = $this->container->get('symbb.extension.tapatalk.manager.user');
            return $manager->markPmRead($messageId);
        } catch (\Exception $exc) {
            return $this->errorResponse($exc);
        }
    }
347703
public function onRead()
    {
        $seq = ["\xff\xf4\xff\xfd\x06", "\xff\xec", "\x03", "\x04"];
        $finish = false;
        foreach ($seq as $s) {
            if ($this->search($s) !== false) {
                $finish = true;
            }
        }
        while (($line = $this->readline()) !== null) {
            $line = rtrim($line, "\r\n");
            $e = explode(' ', $line, 2);
            $cmd = trim(strtolower($e[0]));
            $arg = isset($e[1]) ? $e[1] : '';

            if ($cmd === 'quit' || $cmd === 'exit') {
                $this->disconnect();
            } elseif (!$this->auth) {
                $this->checkPassword($line);
            } else {
                $this->processCommand($cmd, $arg);
            }
        }

        if ($finish) {
            $this->finish();
        }
    }
73393
public function onRead()
    {
        if (($head = $this->lookExact(static::HEADER_LENGTH)) === false) {
            return;
        }

        list($magic, $typeInt, $size) = unpack(static::HEADER_READ_FORMAT, $head);

        if ($this->getInputLength() < static::HEADER_LENGTH + $size) {
            return;
        }

        $this->drain(static::HEADER_LENGTH);
        $pct = $this->read($size);

        if ($magic === static::MAGIC_RESPONSE) {
            $this->responseType = static::$responseCommandListFlipped[$typeInt];
            $this->response = explode(static::ARGS_DELIMITER, $pct);
            $this->onResponse->executeOne($this);
            $this->responseType = null;
            $this->responseCommand = null;
            $this->responseType = null;
            $this->checkFree();
            return;
        } else {
            $type = static::$requestCommandListFlipped[$typeInt];
            // @TODO
        }
    }
435314
protected function _peekRead() {
		$status = strtok($this->_read(), ' ');

		switch ($status) {
			case 'FOUND':
				return [
					'id' => (integer) strtok(' '),
					'body' => $this->_read((integer) strtok(' '))
				];
			case 'NOT_FOUND':
			default:
				$this->_error($status);
				return false;
		}
	}
924008
public function markAsRead(int $messageId)
    {
        $this->sql = 'update message set is_read = \'Y\' where id = ?';
        $this->bindValues[] = $messageId;

        return $this->execute();
    }
1304796
public function setPreferRead()
    {
        //====================================================================//
        // Safety Checks ==> Verify a new Field Exists
        if (empty($this->new)) {
            Splash::log()->err("ErrFieldsNoNew");
        } else {
            //====================================================================//
            // Update New Field structure
            $this->new->syncmode = self::MODE_READ;
        }

        return $this;
    }
123887
public function onRead()
    {
        while (!is_null($line = $this->readline())) {
            $finish =
                (mb_orig_strpos($line, $s = "\xff\xf4\xff\xfd\x06") !== false)
                || (mb_orig_strpos($line, $s = "\xff\xec") !== false)
                || (mb_orig_strpos($line, $s = "\x03") !== false)
                || (mb_orig_strpos($line, $s = "\x04") !== false);

            $e = explode(' ', rtrim($line, "\r\n"), 2);

            $cmd = trim($e[0]);

            if ($cmd === 'ping') {
                $this->writeln('pong');
            } elseif (
                ($cmd === 'exit')
                || ($cmd === 'quit')
            ) {
                $this->finish();
            } else {
                $this->writeln('Unknown command "' . $cmd . '"');
            }

            if (
                (mb_orig_strlen($line) > 1024)
                || $finish
            ) {
                $this->finish();
            }
        }
    }
144120
public function readNotifyHeap(): self
    {
        foreach ($this->notifyHeap as $notifyIndex => $notifyDatas) {
            $this->action  = $notifyDatas->action;
            $this->context = $notifyDatas->context;
            
            $this->notify();
            
            //Remove the current notification from list
            unset($this->notifyHeap[$notifyIndex]);
        }
        
        //Some new notifications has been added during the loop
        if (count($this->notifyHeap) > 0) {
            $this->readNotifyHeap();
        }

        return $this;
    }