-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JeroenG\Explorer\Application; | ||
|
||
interface BeIndexed | ||
{ | ||
public function prepareIndexAction(array $indexAction): array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JeroenG\Explorer\Tests\Support\Models; | ||
|
||
use JeroenG\Explorer\Application\BeIndexed; | ||
use JeroenG\Explorer\Application\Explored; | ||
|
||
class TestModelWithIndexed implements Explored, BeIndexed | ||
{ | ||
public function getScoutKey(): string | ||
{ | ||
return ':scout_key:'; | ||
} | ||
|
||
public function searchableAs(): string | ||
{ | ||
return ':searchable_as:'; | ||
} | ||
|
||
public function toSearchableArray(): array | ||
{ | ||
return [ 'data' => true ]; | ||
} | ||
|
||
public function mappableAs(): array | ||
{ | ||
return [ | ||
'data' => [ 'type' => 'boolean' ] | ||
]; | ||
} | ||
|
||
public function prepareIndexAction(array $action): array | ||
{ | ||
$action['index']['_routing'] = ':routing_key:'; | ||
|
||
return $action; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters