forked from studioespresso/craft-scout
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shouldBeSearchableEvent for studioespresso#205
- Loading branch information
1 parent
dc9054b
commit c0e9594
Showing
2 changed files
with
43 additions
and
5 deletions.
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,25 @@ | ||
<?php | ||
|
||
namespace rias\scout\events; | ||
|
||
use craft\base\Element; | ||
use yii\base\Event; | ||
|
||
/** | ||
* This event fires as apart of the chain that checks wether or not an element should be marked as searchable. | ||
* By settings `shouldBeSearchable` to false, you can change default behavior for certain elements or element types | ||
*/ | ||
class ShouldBeSearchableEvent extends Event | ||
{ | ||
/** | ||
* Element that is being saved | ||
* @var Element | ||
*/ | ||
public $element; | ||
|
||
/** | ||
* Wether or not the element should be marked as searchable | ||
* @var bool | ||
*/ | ||
public $shouldBeSearchable = true; | ||
} |