Apply fixes from StyleCI
This commit is contained in:
parent
4240269b7f
commit
f8aa3dcf13
16
extend.php
16
extend.php
|
|
@ -1,11 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search;
|
||||
|
||||
use Flarum\Extend as Flarum;
|
||||
|
||||
return [
|
||||
(new Flarum\ServiceProvider)->register(Provider::class),
|
||||
(new Flarum\ServiceProvider())->register(Provider::class),
|
||||
|
||||
(new Flarum\Frontend('forum'))
|
||||
->js(__DIR__.'/js/dist/forum.js'),
|
||||
|
|
@ -18,6 +28,6 @@ return [
|
|||
->get('/blomstra/search/{type}', 'blomstra.search', Api\Controllers\SearchController::class)
|
||||
->put('/blomstra/search/index', 'blomstra.search.index', Api\Controllers\IndexController::class),
|
||||
|
||||
(new Flarum\Console)
|
||||
->command(Commands\BuildCommand::class)
|
||||
(new Flarum\Console())
|
||||
->command(Commands\BuildCommand::class),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Api;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
|
@ -9,7 +19,9 @@ class Client extends \Flarum\Api\Client
|
|||
{
|
||||
public function get(string $path): ResponseInterface
|
||||
{
|
||||
if ($path === '/discussions' && Arr::has($this->queryParams, 'filter.q')) return parent::get("/blomstra/search/discussions");
|
||||
if ($path === '/discussions' && Arr::has($this->queryParams, 'filter.q')) {
|
||||
return parent::get('/blomstra/search/discussions');
|
||||
}
|
||||
|
||||
return parent::get($path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Api\Controllers;
|
||||
|
||||
use Blomstra\Search\Commands\BuildCommand;
|
||||
|
|
@ -23,7 +33,8 @@ class IndexController implements RequestHandlerInterface
|
|||
|
||||
$command->run(
|
||||
new ArrayInput([]),
|
||||
new ConsoleOutput);
|
||||
new ConsoleOutput()
|
||||
);
|
||||
|
||||
return new EmptyResponse();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Api\Controllers;
|
||||
|
||||
use Blomstra\Search\Elasticsearch\MatchPhraseQuery;
|
||||
use Blomstra\Search\Elasticsearch\MatchQuery;
|
||||
use Blomstra\Search\Save\Document as ElasticDocument;
|
||||
use Blomstra\Search\Elasticsearch\TermsQuery;
|
||||
use Blomstra\Search\Save\Document as ElasticDocument;
|
||||
use Elasticsearch\Client;
|
||||
use Flarum\Api\Controller\ListDiscussionsController;
|
||||
use Flarum\Api\Serializer\DiscussionSerializer;
|
||||
|
|
@ -34,11 +44,12 @@ class SearchController extends ListDiscussionsController
|
|||
protected array $translateSort = [
|
||||
'lastPostedAt' => 'updated_at',
|
||||
'createdAt' => 'created_at',
|
||||
'commentCount' => 'comment_count'
|
||||
'commentCount' => 'comment_count',
|
||||
];
|
||||
|
||||
public function __construct(protected Client $elastic, protected UrlGenerator $uri)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
protected function data(ServerRequestInterface $request, Document $document)
|
||||
{
|
||||
|
|
@ -106,19 +117,19 @@ class SearchController extends ListDiscussionsController
|
|||
if ($type === 'posts') {
|
||||
return [
|
||||
'most_relevant_post_id' => $id,
|
||||
'weight' => Arr::get($hit, 'sort.0')
|
||||
'weight' => Arr::get($hit, 'sort.0'),
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
'discussion_id' => $id,
|
||||
'weight' => Arr::get($hit, 'sort.0')
|
||||
'weight' => Arr::get($hit, 'sort.0'),
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
$document->addPaginationLinks(
|
||||
$this->uri->to('api')->route('blomstra.search', [
|
||||
'type' => 'discussions'
|
||||
'type' => 'discussions',
|
||||
]),
|
||||
$request->getQueryParams(),
|
||||
$offset,
|
||||
|
|
@ -287,7 +298,6 @@ class SearchController extends ListDiscussionsController
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
protected function getGroups(User $actor): Collection
|
||||
{
|
||||
/** @var Collection $groups */
|
||||
|
|
|
|||
|
|
@ -1,11 +1,20 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Commands;
|
||||
|
||||
use Blomstra\Search\Jobs\Job;
|
||||
use Blomstra\Search\Jobs\SavingJob;
|
||||
use Blomstra\Search\Seeders\Seeder;
|
||||
use Carbon\Carbon;
|
||||
use Elasticsearch\Client;
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use Illuminate\Console\Command;
|
||||
|
|
@ -52,14 +61,14 @@ class BuildCommand extends Command
|
|||
'recipient_groups' => ['type' => 'integer'],
|
||||
'recipient_users' => ['type' => 'integer'],
|
||||
'comment_count' => ['type' => 'integer'],
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
if ($this->option('recreate')) {
|
||||
// Flush the index.
|
||||
$client->indices()->delete([
|
||||
'index' => $index,
|
||||
'ignore_unavailable' => true
|
||||
'ignore_unavailable' => true,
|
||||
]);
|
||||
|
||||
// Create a new index.
|
||||
|
|
@ -71,35 +80,35 @@ class BuildCommand extends Command
|
|||
'analysis' => [
|
||||
'analyzer' => [
|
||||
'flarum_analyzer' => [
|
||||
'type' => $settings->get('blomstra-search.analyzer-language') ?: 'english'
|
||||
'type' => $settings->get('blomstra-search.analyzer-language') ?: 'english',
|
||||
],
|
||||
'flarum_analyzer_partial' => [
|
||||
'type' => 'custom',
|
||||
'tokenizer' => 'standard',
|
||||
'filter' => [
|
||||
'lowercase',
|
||||
'partial_search_filter'
|
||||
]
|
||||
]
|
||||
'partial_search_filter',
|
||||
],
|
||||
],
|
||||
],
|
||||
'filter' => [
|
||||
'partial_search_filter' => [
|
||||
'type' => 'ngram',
|
||||
'min_gram' => 1,
|
||||
'max_gram' => 10,
|
||||
'token_chars' => ['letter', 'digit', 'symbol']
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
'token_chars' => ['letter', 'digit', 'symbol'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->option('recreate') || $this->option('mapping')) {
|
||||
$client->indices()->putMapping([
|
||||
'index' => $index,
|
||||
'body' => $properties
|
||||
'body' => $properties,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +116,9 @@ class BuildCommand extends Command
|
|||
|
||||
/** @var Seeder $seeder */
|
||||
foreach ($seeders as $seeder) {
|
||||
if ($only && $seeder->type() !== $only) continue;
|
||||
if ($only && $seeder->type() !== $only) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$total = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Elasticsearch;
|
||||
|
||||
use Spatie\ElasticsearchQueryBuilder\Queries\MatchQuery;
|
||||
|
|
@ -22,7 +32,7 @@ class MatchPhraseQuery extends MatchQuery
|
|||
$query[$this->field]['boost'] = $this->boost;
|
||||
|
||||
return [
|
||||
'match_phrase' => $query
|
||||
'match_phrase' => $query,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Elasticsearch;
|
||||
|
||||
class MatchQuery extends \Spatie\ElasticsearchQueryBuilder\Queries\MatchQuery
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Elasticsearch;
|
||||
|
||||
use Spatie\ElasticsearchQueryBuilder\Queries\Query;
|
||||
|
|
@ -42,8 +52,8 @@ class SimpleSearchQuery implements Query
|
|||
'fields' => $this->fields,
|
||||
'analyzer' => $this->analyzer,
|
||||
'default_operator' => 'AND',
|
||||
'boost' => $this->boost
|
||||
]
|
||||
'boost' => $this->boost,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Elasticsearch;
|
||||
|
||||
use Spatie\ElasticsearchQueryBuilder\Queries\Query;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Elasticsearch;
|
||||
|
||||
class WildcardQuery extends \Spatie\ElasticsearchQueryBuilder\Queries\WildcardQuery
|
||||
|
|
@ -38,7 +48,6 @@ class WildcardQuery extends \Spatie\ElasticsearchQueryBuilder\Queries\WildcardQu
|
|||
|
||||
if ($this->rewrite) {
|
||||
$query['wildcard'][$this->field]['rewrite'] = $this->rewrite;
|
||||
|
||||
}
|
||||
|
||||
return $query;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,22 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Exceptions;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class SeedingException extends \Exception
|
||||
{
|
||||
|
||||
public function __construct($message = "", public array $items, $code = 0, Throwable $previous = null)
|
||||
public function __construct($message = '', public array $items, $code = 0, Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Jobs;
|
||||
|
||||
use Elasticsearch\Client;
|
||||
|
|
@ -9,21 +19,23 @@ class DeletingJob extends Job
|
|||
{
|
||||
public function handle(Client $client)
|
||||
{
|
||||
if ($this->models->isEmpty()) return;
|
||||
if ($this->models->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Preparing body for storing.
|
||||
$body = $this->models->map(function (Model $model) {
|
||||
$document = $this->seeder->toDocument($model);
|
||||
|
||||
return [
|
||||
['delete' => ['_index' => $this->index, '_id' => $document->id]]
|
||||
['delete' => ['_index' => $this->index, '_id' => $document->id]],
|
||||
];
|
||||
})->flatten(1);
|
||||
|
||||
$response = $client->bulk([
|
||||
'index' => $this->index,
|
||||
'body' => $body->toArray(),
|
||||
'refresh' => true
|
||||
'refresh' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Jobs;
|
||||
|
||||
use Blomstra\Search\Seeders\Seeder;
|
||||
|
|
@ -16,6 +26,8 @@ abstract class Job extends AbstractJob
|
|||
{
|
||||
$this->index = resolve('blomstra.search.elastic_index');
|
||||
|
||||
if (static::$onQueue) $this->onQueue(static::$onQueue);
|
||||
if (static::$onQueue) {
|
||||
$this->onQueue(static::$onQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Jobs;
|
||||
|
||||
use Blomstra\Search\Exceptions\SeedingException;
|
||||
|
|
@ -11,7 +21,9 @@ class SavingJob extends Job
|
|||
{
|
||||
public function handle(Client $client)
|
||||
{
|
||||
if ($this->models->isEmpty()) return;
|
||||
if ($this->models->isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Preparing body for storing.
|
||||
$body = $this->models->map(function (Model $model) {
|
||||
|
|
@ -19,7 +31,7 @@ class SavingJob extends Job
|
|||
|
||||
return [
|
||||
['index' => ['_index' => $this->index, '_id' => $document->id]],
|
||||
$document->toArray()
|
||||
$document->toArray(),
|
||||
];
|
||||
})
|
||||
->flatten(1);
|
||||
|
|
@ -27,10 +39,12 @@ class SavingJob extends Job
|
|||
$response = $client->bulk([
|
||||
'index' => $this->index,
|
||||
'body' => $body->toArray(),
|
||||
'refresh' => true
|
||||
'refresh' => true,
|
||||
]);
|
||||
|
||||
if (Arr::get($response, 'errors') !== true) return true;
|
||||
if (Arr::get($response, 'errors') !== true) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$items = Arr::get($response, 'items');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,20 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search;
|
||||
|
||||
use Blomstra\Search\Jobs\DeletingJob;
|
||||
use Blomstra\Search\Jobs\Job;
|
||||
use Blomstra\Search\Jobs\SavingJob;
|
||||
use Blomstra\Search\Seeders;
|
||||
use Elasticsearch\Client as Elastic;
|
||||
use Elasticsearch\ClientBuilder;
|
||||
use Flarum\Api\Client;
|
||||
|
|
@ -53,7 +62,6 @@ class Provider extends AbstractServiceProvider
|
|||
return $builder->build();
|
||||
});
|
||||
|
||||
|
||||
$this->container->instance(
|
||||
'blomstra.search.elastic_index',
|
||||
$settings->get('blomstra-search.elastic-index', 'flarum')
|
||||
|
|
@ -62,7 +70,7 @@ class Provider extends AbstractServiceProvider
|
|||
$this->container->extend(
|
||||
Client::class,
|
||||
function () {
|
||||
$pipe = new MiddlewarePipe;
|
||||
$pipe = new MiddlewarePipe();
|
||||
|
||||
$exclude = resolve('flarum.api_client.exclude_middleware');
|
||||
|
||||
|
|
@ -74,7 +82,7 @@ class Provider extends AbstractServiceProvider
|
|||
$pipe->pipe(resolve($middleware));
|
||||
}
|
||||
|
||||
$pipe->pipe(new ExecuteRoute);
|
||||
$pipe->pipe(new ExecuteRoute());
|
||||
|
||||
return new Api\Client($pipe);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Save;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Seeders;
|
||||
|
||||
use Blomstra\Search\Save\Document;
|
||||
|
|
@ -15,7 +25,7 @@ class CommentSeeder extends Seeder
|
|||
{
|
||||
public function type(): string
|
||||
{
|
||||
return resolve(PostSerializer::class)->getType(new CommentPost);
|
||||
return resolve(PostSerializer::class)->getType(new CommentPost());
|
||||
}
|
||||
|
||||
public function query(): Builder
|
||||
|
|
@ -53,6 +63,7 @@ class CommentSeeder extends Seeder
|
|||
|
||||
/**
|
||||
* @param CommentPost $model
|
||||
*
|
||||
* @return Document
|
||||
*/
|
||||
public function toDocument(Model $model): Document
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Seeders;
|
||||
|
||||
use Blomstra\Search\Save\Document;
|
||||
|
|
@ -17,7 +27,7 @@ class DiscussionSeeder extends Seeder
|
|||
{
|
||||
public function type(): string
|
||||
{
|
||||
return resolve(DiscussionSerializer::class)->getType(new Discussion);
|
||||
return resolve(DiscussionSerializer::class)->getType(new Discussion());
|
||||
}
|
||||
|
||||
public function query(): Builder
|
||||
|
|
@ -32,6 +42,7 @@ class DiscussionSeeder extends Seeder
|
|||
$includes[] = 'recipientUsers';
|
||||
$includes[] = 'recipientGroups';
|
||||
}
|
||||
|
||||
return Discussion::query()
|
||||
->whereNull('hidden_at')
|
||||
->with($includes);
|
||||
|
|
@ -53,6 +64,7 @@ class DiscussionSeeder extends Seeder
|
|||
|
||||
/**
|
||||
* @param Discussion $model
|
||||
*
|
||||
* @return Document
|
||||
*/
|
||||
public function toDocument(Model $model): Document
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of blomstra/search.
|
||||
*
|
||||
* Copyright (c) 2022 Blomstra Ltd.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE.md
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Blomstra\Search\Seeders;
|
||||
|
||||
use Blomstra\Search\Save\Document;
|
||||
|
|
@ -20,6 +30,7 @@ abstract class Seeder
|
|||
abstract public function query(): Builder;
|
||||
|
||||
abstract public static function savingOn(Dispatcher $events, callable $callable);
|
||||
|
||||
abstract public static function deletingOn(Dispatcher $events, callable $callable);
|
||||
|
||||
abstract public function toDocument(Model $model): Document;
|
||||
|
|
|
|||
Loading…
Reference in New Issue