| 1 | <?php |
||
| 14 | class Util |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Parse relationship paths. |
||
| 18 | * |
||
| 19 | * Given a flat array of relationship paths like: |
||
| 20 | * |
||
| 21 | * ['user', 'user.employer', 'user.employer.country', 'comments'] |
||
| 22 | * |
||
| 23 | * create a nested array of relationship paths one-level deep that can |
||
| 24 | * be passed on to other serializers: |
||
| 25 | * |
||
| 26 | * ['user' => ['employer', 'employer.country'], 'comments' => []] |
||
| 27 | * |
||
| 28 | * @param array $paths |
||
| 29 | * |
||
| 30 | * @return array |
||
| 31 | */ |
||
| 32 | 36 | public static function parseRelationshipPaths(array $paths) |
|
| 50 | } |
||
| 51 |