Microweber\Providers\NotificationsManager::mark_all_as_read PHP Method

mark_all_as_read() public method

public mark_all_as_read ( )
    public function mark_all_as_read()
    {
        $is_admin = $this->app->user_manager->is_admin();
        if (defined('MW_API_CALL') and $is_admin == false) {
            return array('error' => 'You must be logged in as admin to perform: ' . __CLASS__ . '->' . __FUNCTION__);
        }
        \DB::table($this->table)->whereIsRead(0)->update(['is_read' => 1]);
        $this->app->cache_manager->delete('notifications' . DIRECTORY_SEPARATOR . 'global');
        return true;
    }