src/Collection.php
protected function buildResources($data, SerializerInterface $serializer)
    {
        $resources = [];

        foreach ($data as $resource) {
            if (! ($resource instanceof Resource)) {
                $resource = new Resource($resource, $serializer);
            }

            $resources[] = $resource;
        }

        return $resources;
    }
protected function buildResources($data, SerializerInterface $serializer)
    {
        $resources = [];

        foreach ($data as $resource) {
            if (! ($resource instanceof Resource)) {
                $resource = new Resource($resource, $serializer);
            }

            $resources[] = $resource;
        }

        return $resources;
    }
protected function buildResources ( $ data , SerializerInterface $ serializer ) { $ resources = [ ] ; foreach ( $ data as $ resource ) { if ( ! ( $ resource instanceof Resource ) ) { $ resource = new Resource ( $ resource , $ serializer ) ; } $ resources [ ] = $ resource ; } return $ resources ; }
Convert an array of raw data to Resource objects.

@param mixed $data
@param SerializerInterface $serializer

@return \Tobscure\JsonApi\Resource[]
Convert an array of raw data to Resource objects .