| Total Complexity | 5 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Coverage | 83.33% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | trait DocumentFactoryTrait |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var FieldResolver Resolver for fields |
||
| 22 | */ |
||
| 23 | protected $fieldResolver; |
||
| 24 | /** |
||
| 25 | * @var null|ArrayList|DataList Items to create documents for |
||
| 26 | */ |
||
| 27 | protected $items; |
||
| 28 | /** |
||
| 29 | * @var string Current class that's being indexed |
||
| 30 | */ |
||
| 31 | protected $class; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Current class being indexed |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function getClass(): string |
||
| 39 | { |
||
| 40 | return $this->class; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Set the current class to be indexed |
||
| 45 | * |
||
| 46 | * @param string $class |
||
| 47 | * @return DocumentFactory |
||
| 48 | */ |
||
| 49 | 6 | public function setClass(string $class): self |
|
| 50 | { |
||
| 51 | 6 | $this->class = $class; |
|
| 52 | |||
| 53 | 6 | return $this; |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Get the FieldResolver class |
||
| 58 | * |
||
| 59 | * @return FieldResolver |
||
| 60 | */ |
||
| 61 | 7 | public function getFieldResolver(): FieldResolver |
|
| 62 | { |
||
| 63 | 7 | return $this->fieldResolver; |
|
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Get the items being indexed |
||
| 68 | * |
||
| 69 | * @return ArrayList|DataList|null |
||
| 70 | */ |
||
| 71 | 6 | public function getItems() |
|
| 72 | { |
||
| 73 | 6 | return $this->items; |
|
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Set the items to index |
||
| 78 | * |
||
| 79 | * @param ArrayList|DataList|null $items |
||
| 80 | * @return DocumentFactory |
||
| 81 | */ |
||
| 82 | 6 | public function setItems($items): self |
|
| 87 | } |
||
| 88 | } |
||
| 89 |