MetaModels / core

MetaModels Core Module
GNU Lesser General Public License v3.0
96 stars 42 forks source link

Add getters and setters for url settings. #1377

Closed richardhj closed 4 years ago

richardhj commented 4 years ago

Description

I need to change URL suffix on runtime, and decorating the service seems superfluous for me.

I use the URL builder on a custom route. This custom route uses .ics as URL suffix. I need the URL builder to strip of the URL suffix.

  /**
     * @Route("/items/{urlParams}.ics", requirements={"urlParams"=".+"})
     */
    public function __invoke(string $urlParams, Request $request)
    {
        $metaModel = $this->metaModelFactory->getMetaModel('mm_test');
        if (null === $metaModel) {
            throw new RuntimeException('Could not instantiate MetaModel: mm_test');
        }
        $filterUrl = $this->filterUrlBuilder->getCurrentFilterUrl();
    }

Checklist

zonky2 commented 4 years ago

@richardhj can you push this at gitlab? base ist feature/2.2.0

discordier commented 4 years ago

As this is a service, the setters are not acceptable as this would introduce a state to the service.

Decoration or cloning of the service would be in fact the way to go here.

Please move to gitlab to discuss this.