Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Trying to solve issue ZF2-558 #2393
I think this is a bad solution (or I'm missing something). There's no guarantee that if $this->validator is not an instance of InArray that whatever it is implements a getValidator() method. It's not clear to me what $this->validator is expected to be if the instanceof test fails (which is why I'm not providing an alternative solution).
For instance, this change appears to break DoctrineORMModule\Form\Element\DoctrineEntity, which overrides Select::getValidator().
Aha! This patch assumes that $this->validator is either an instanceof InArray or Explode. I've fixed my problem for now by simply subclassing DoctrineEntity and overriding setValueOptions() to behave like it did before this commit. I suppose I could put a pull request in for DoctrineORMModule to do the same there, which would fix the issue. But perhaps there's a more elegant solution at this level.