mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
93fd869ba3
Phasing out the view service from being a generic 'service' class, moving the core create/delete methods into the model. The idea is that the existing query work will need to interlink with the favourite system so maybe we have a (or many composable) query building classes rather than mixing query building and create/delete work as per the old service.
44 lines
774 B
PHP
44 lines
774 B
PHP
<?php
|
|
|
|
namespace BookStack\Console\Commands;
|
|
|
|
use BookStack\Actions\View;
|
|
use Illuminate\Console\Command;
|
|
|
|
class ClearViews extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'bookstack:clear-views';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Clear all view-counts for all entities';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle()
|
|
{
|
|
View::clearAll();
|
|
$this->comment('Views cleared');
|
|
}
|
|
}
|