PHP Class Tobscure\JsonApi\Util

Show file Open project: tobscure/json-api Class Usage Examples

Public Methods

Method Description
parseRelationshipPaths ( array $paths ) : array Parse relationship paths.

Method Details

parseRelationshipPaths() public static method

Given a flat array of relationship paths like: ['user', 'user.employer', 'user.employer.country', 'comments'] create a nested array of relationship paths one-level deep that can be passed on to other serializers: ['user' => ['employer', 'employer.country'], 'comments' => []]
public static parseRelationshipPaths ( array $paths ) : array
$paths array
return array