getResource(url, options) {
        options = options || {};

        let objects = this.urls.getByUrl(url);

        if (!objects.length) {
            if (!this.hasFinished()) {
                throw new errors.InternalServerError({
                    message: 'UrlService is processing.',
                    code: 'URLSERVICE_NOT_READY'
                });
            } else {
                return null;
            }
        }

        if (objects.length > 1) {
            objects = _.reduce(objects, (toReturn, object) => {
                if (!toReturn.length) {
                    toReturn.push(object);
                } else {
                    const i1 = _.findIndex(this.urlGenerators, {uid: toReturn[0].generatorId});
                    const i2 = _.findIndex(this.urlGenerators, {uid: object.generatorId});

                    if (i2 < i1) {
                        toReturn = [];
                        toReturn.push(object);
                    }
                }

                return toReturn;
            }, []);
        }

        if (options.returnEverything) {
            return objects[0];
        }

        return objects[0].resource;
    }
@description Get Resource by url.

You have a url and want to know which the url belongs to.

It's in theory possible that multiple resources generate the same url,
but they both would serve different content.

e.g. if we remove the slug uniqueness and you create a static
page and a post with the same slug. And both are served under `/` with the permalink `/:slug/`.


Each url is unique and it depends on the hierarchy of router registration is configured.
There is no url collision, everything depends on registration order.

e.g. posts which live in a collection are stronger than a static page.

We only return the resource, which would be served.

@NOTE: only accepts relative urls at the moment.

@param {String} url
@param {Object} options
@returns {Object}