Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Change to InputFilterFactory and CollectionInputFilter to support nested input-filter config #3

Closed
wants to merge 1 commit into from
Closed

Conversation

nobesnickr
Copy link
Contributor

I've had some difficulty implementing InputFilterFactory via array config when needing to implement nested CollectionInputFilter; Specifically when using zf-content-validation.

My use case is such that input will have nested entities (and associated input filter configurations), and my problems arose from having to explicitly re-define/duplicate the validators because the base InputFilterPluginManager was not available downstream.

I'm suggesting the following changes that I've made to resolve this:

  1. Added the InputFilterPluginManager to new InputFilterFactory instances created via the Input Filter Abstract Service Factory.
  2. Added functionality to retrieve nested InputFilters on the CollectionInputFilter via the Service Manager if available (allowing for nested InputFilter configurations).

I encourage feedback and will be happy to re-work as needed as there may be a reason the InputFilterManager wasn't supplied in the factory initially.

…ractServiceFactory, added method to get InputFilter from nested CollectionInputFilter configuration
@manuakasam
Copy link

I'm not so sure about what the use-case is here. Aren't you doing something
like this?

FormFilter >
    $nestedfilter = new CollectionInputFilter();
    $nestedFilter->setInputFilter(new SingleModelFilter($dependencies));

    $this->add($nestedFilter, 'my-nested-models');

Instead of new SingleModelFilter() you could also simply get access to
the pluginmanager there and get it from there (hence, even better inject
the singleModelfilter as dependency in your formFilter).

Phillip McCaffrey notifications@github.com schrieb am Sa., 30. Mai 2015
um 00:54 Uhr:

I've had some difficulty implementing InputFilterFactory via array config
when needing to implement nested CollectionInputFilter; Specifically when
using zf-content-validation.

My use case is such that input will have nested entities (and associated
input filter configurations), and my problems arose from having to
explicitly re-define/duplicate the validators because the base
InputFilterPluginManager was not available downstream.

I'm suggesting the following changes that I've made to resolve this:

  1. Added the InputFilterPluginManager to new InputFilterFactory instances
    created via the Input Filter Abstract Service Factory.
  2. Added functionality to retrieve nested InputFilters on the
    CollectionInputFilter via the Service Manager if available (allowing for
    nested InputFilter configurations).

I encourage feedback and will be happy to re-work as needed as there may

be a reason the InputFilterManager wasn't supplied in the factory initially.

You can view, comment on, or merge this pull request online at:

#3
Commit Summary

  • Retrieving the InputFilterManager from the ServiceManager in the
    AbstractServiceFactory, added method to get InputFilter from nested
    CollectionInputFilter configuration

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#3.

@weierophinney weierophinney added this to the 2.7.0 milestone Apr 7, 2016
@weierophinney weierophinney self-assigned this Apr 7, 2016
weierophinney added a commit that referenced this pull request Apr 7, 2016
Change to InputFilterFactory and CollectionInputFilter to support nested input-filter config
weierophinney added a commit that referenced this pull request Apr 7, 2016
weierophinney added a commit that referenced this pull request Apr 7, 2016
@weierophinney
Copy link
Member

Merged to develop for release with 2.7.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants