| Conditions | 7 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function getDocumentFieldValue($entity) |
||
| 12 | { |
||
| 13 | $entityValue = $this->getEntityFieldValue($entity); |
||
| 14 | $documentValue = ''; |
||
| 15 | if (is_scalar($entityValue)) { |
||
| 16 | $documentValue = strval($entityValue); |
||
| 17 | } elseif (is_array($entityValue) || $entityValue instanceof \Iterator || $entityValue instanceof \IteratorAggregate) { |
||
| 18 | $documentValue = []; |
||
| 19 | foreach ($entityValue as $value) { |
||
| 20 | $documentValue[] = (string) $value; |
||
| 21 | } |
||
| 22 | |||
| 23 | $documentValue = join(',', $documentValue); |
||
| 24 | } elseif (is_object($entityValue)) { |
||
| 25 | $documentValue = (string) $entityValue; |
||
| 26 | } |
||
| 27 | |||
| 28 | return $documentValue; |
||
| 29 | } |
||
| 30 | } |