Lines
0.00%
0 / 10
Functions and Methods
0.00%
0 / 1
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| SearchResult | 0.00% | 0 / 10 | 0.00% | 0 / 1 | 2 | 0.00% | 0 / 1 | |||
| create | 0.00% | 0 / 10 | 0.00% | 0 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | /** | |
| 4 | * @package Zmsdldb | |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG | |
| 6 | **/ | |
| 7 | ||
| 8 | namespace BO\Zmsdldb\Entity; | |
| 9 | ||
| 10 | /** | |
| 11 | * Helper for service export | |
| 12 | * | |
| 13 | */ | |
| 14 | class SearchResult extends Base | |
| 15 | { | |
| 16 | public static function create(mixed $item): self | |
| 17 | { | |
| 18 | $type = explode('\\', get_class($item)); | |
| 19 | $data = array( | |
| 20 | 'id' => $item->getId(), | |
| 21 | 'type' => end($type), | |
| 22 | 'name' => $item->getName(), | |
| 23 | 'path' => $item->getPath(), | |
| 24 | 'locale' => $item->getLocale(), | |
| 25 | 'link' => $item->getLink(), | |
| 26 | ); | |
| 27 | return new self($data); | |
| 28 | } | |
| 29 | } |