public static function buildFromArray(array $resources)
    {
        $resource = @$resources[0];

        if (!$resource instanceof EntityResource) {
            throw new LogicException(self::ERROR_EMPTY_ARRAY);
        }

        return new static($resources, $resource->getMetadata());
    }