1 | <?php |
||
2 | /** |
||
3 | * Class DocumentFactoryExtension|Firesphere\SolrPermissions\Extensions\DocumentFactoryExtension Update the documents |
||
4 | * fields with the MemberView settings |
||
5 | * |
||
6 | * @package Firesphere\Solr\Permissions |
||
7 | * @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo |
||
8 | * @copyright Copyright (c) 2018 - now() Firesphere & Sheepy |
||
9 | */ |
||
10 | |||
11 | namespace Firesphere\SolrPermissions\Extensions; |
||
12 | |||
13 | use Firesphere\SolrSearch\Factories\DocumentFactory; |
||
14 | use SilverStripe\Core\Extension; |
||
15 | use SilverStripe\ORM\DataObject; |
||
16 | use Solarium\Core\Query\DocumentInterface; |
||
17 | |||
18 | /** |
||
19 | * Class \Firesphere\SolrPermissions\Extensions\DocumentFactoryExtension |
||
20 | * |
||
21 | * Extension class to add the default MemberView field to the Solr document |
||
22 | * |
||
23 | * @package Firesphere\Solr\Permissions |
||
24 | * @property DocumentFactory|DocumentFactoryExtension $owner |
||
25 | */ |
||
26 | class DocumentFactoryExtension extends Extension |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * Add the MemberView status to the default fields |
||
31 | * |
||
32 | * @param DocumentInterface $doc |
||
33 | * @param DataObject|DataObjectExtension $item |
||
34 | */ |
||
35 | 1 | public function updateDefaultFields(&$doc, $item) |
|
36 | { |
||
37 | 1 | $doc->addField('MemberView', $item->getMemberView()); |
|
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
38 | 1 | } |
|
39 | } |
||
40 |