Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Zend\Form\Form has to override getHydrator() method as setHydrator(..) is. #2661

Closed
eimanavicius opened this Issue · 3 comments

2 participants

Nerijus Eimanavičius Martin Keckeis
Nerijus Eimanavičius

Fieldset (set as base fieldset) has ClassMethodsHydrator but if call getHydrator on Form that hydrator is changed to default one.

http://pastie.org/private/lsnyegz51556w7iay9az9g

I think overridden getHydrator() should look like:

public function getHydrator() {
        if ($this->baseFieldset !== null) {
            return $this->baseFieldset->getHydrator();
        }
        return parent::getHydrator();
}
Martin Keckeis

@Hamlis i think this cannot be done.

Simple reason: Fieldset and form can be "independent" so in the Form you can also have a own hydrator and own elements...(also Form extends Fieldset...so it's partly a "fieldset")

If it's okay for you -> can this get closed?

Nerijus Eimanavičius

I agree with you "Fieldset and form can be "independent"", but then:

$form->setHydrator($hydrator);
$hydrator != $form->getHydrator()

setHydrator should not be overrided to set hydrator for baseFieldset

Nerijus Eimanavičius

This issue can be closed. I did not tracked when the change was made, but now hydrator setters and getters works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.