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

Fixes #4521 #5857

Merged
merged 2 commits into from
Apr 14, 2014
Merged

Fixes #4521 #5857

merged 2 commits into from
Apr 14, 2014

Conversation

samsonasik
Copy link
Contributor

Fixes #4521

@mwillbanks
Copy link
Contributor

This could potentially have negative side effects. Generally the select instance becomes cached and this removes it which if you build out a select and then call getSelect it may rebuild the select again. Maybe it should be resolved by instantiating the object?

@samsonasik
Copy link
Contributor Author

what you mean by instantiating the object ? the issue is when same object re-populate the options data with other option. what your suggestion ?

@weierophinney
Copy link
Member

@samsonasik I'd argue that the better approach is to reset the $select property when any of the $table, $schema, $field, or $exclude properties change. This way the Select object can be cached and only rebuilt when necessary.

@samsonasik
Copy link
Contributor Author

@weierophinney done ;). Added condition to reset $select only if $table, $schema, $field, or $exclude properties changed.

weierophinney added a commit that referenced this pull request Apr 14, 2014
weierophinney added a commit that referenced this pull request Apr 14, 2014
- Reset the select object whenever any of the various setters are called that
  could modify the behavior of the select.
weierophinney added a commit that referenced this pull request Apr 14, 2014
@weierophinney weierophinney added this to the 2.3.1 milestone Apr 14, 2014
@weierophinney weierophinney merged commit 32d6030 into zendframework:master Apr 14, 2014
weierophinney added a commit that referenced this pull request Apr 14, 2014
@weierophinney
Copy link
Member

Wasn't quite what I was getting at, @samsonasik - but I updated it to do it properly. Essentially, whenever any of the setters are called for table, schema, field, or exclude, the $select property should be nulled, which will force getSelect() to rebuild it on next invocation.

@samsonasik
Copy link
Contributor Author

@weierophinney thank you ;)

weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
- Reset the select object whenever any of the various setters are called that
  could modify the behavior of the select.
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RecordExists validator doesn't apply new table and other options.
4 participants