Ejemplo n.º 1
0
 /**
  * Get an array of built relationships.
  *
  * @return Relationship[]
  */
 protected function buildRelationships()
 {
     $paths = Util::parseRelationshipPaths($this->includes);
     $relationships = [];
     foreach ($paths as $name => $nested) {
         $relationship = $this->serializer->getRelationship($this->data, $name);
         if ($relationship) {
             $relationship->getData()->with($nested)->fields($this->fields);
             $relationships[$name] = $relationship;
         }
     }
     return $relationships;
 }