src/Model/PushNotificationModel.php
public function sendByUserId(int $userId, string $msg, ?string $dest = null, bool $flush = false) : void
    {
        $msg = $this->composeMsg($msg, $dest);

        foreach ($this->subscriptionTable->findActive()->where('user_id', $userId) as $row)
        {
            $this->sendNotification($row, $msg, false);
        }

        if ($flush)
        {
            $this->flush();
        }
    }
public function sendByUserId(int $userId, string $msg, ?string $dest = null, bool $flush = false) : void
    {
        $msg = $this->composeMsg($msg, $dest);

        foreach ($this->subscriptionTable->findActive()->where('user_id', $userId) as $row)
        {
            $this->sendNotification($row, $msg, false);
        }

        if ($flush)
        {
            $this->flush();
        }
    }
public function sendByUserId ( int $ userId , string $ msg , ? string $ dest = null , bool $ flush = false ) : void { $ msg = $ this -> composeMsg ( $ msg , $ dest ) ; foreach ( $ this -> subscriptionTable -> findActive ( ) -> where ( 'user_id' , $ userId ) as $ row ) { $ this -> sendNotification ( $ row , $ msg , false ) ; } if ( $ flush ) { $ this -> flush ( ) ; } }
Send notification to all subscriptions paired with specific user.
@param int $userId
@param string $msg
@param string $dest
@param bool $flush
Send notification to all subscriptions paired with specific user .