-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Back over to property, instead of a calculated field.
Calculated field was getting hit by context, but also leading to some other oddities. Easier just to roll back into the processor, for now.
- Loading branch information
1 parent
92b4b05
commit 3477650
Showing
3 changed files
with
111 additions
and
48 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
34 changes: 34 additions & 0 deletions
34
src/Plugin/search_api/processor/Property/ListableEntityProcessorProperty.php
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,34 @@ | ||
<?php | ||
|
||
namespace Drupal\embargo\Plugin\search_api\processor\Property; | ||
|
||
use Drupal\search_api\Processor\EntityProcessorProperty; | ||
|
||
/** | ||
* Extended EntityProcessorProperty class with some additional setters. | ||
*/ | ||
class ListableEntityProcessorProperty extends EntityProcessorProperty { | ||
|
||
/** | ||
* Set to represent a list. | ||
* | ||
* @param bool $value | ||
* The value to set. Defaults to true. | ||
*/ | ||
public function setList(bool $value = TRUE) : self { | ||
$this->definition['is_list'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Set the processor ID. | ||
* | ||
* @param string $processor_id | ||
* The processor ID to set. | ||
*/ | ||
public function setProcessorId(string $processor_id) : self { | ||
$this->definition['processor_id'] = $processor_id; | ||
return $this; | ||
} | ||
|
||
} |