-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Removing $class->newInstanceArgs($this->creationOptions) from Zend\Paginator\Adapter\Service\DbSelectFactory #6403
Comments
ping @Ocramius I open this issue based on ML : http://zend-framework-community.634137.n4.nabble.com/Removing-class-gt-newInstanceArgs-this-gt-creationOptions-from-Zend-Paginator-Adapter-Service-DbSeley-td4662167.html#a4662171 , Thank you. |
@samsonasik an alternate would be to use a plugin manager, but that would be overkill. I'm not sure if I understand the actual problem being exposed though. |
@Ocramius using pluginmanager is not used here too, because : $this->getServiceLocator()
->get('PaginatorPluginManager')->get('dbselect'); will comes with error because not set yet, and the other invokables classes ( Zend\Paginator\Adapter\ArrayAdapter|Callback|Iterator|Null) that registered at the PaginatorPluginManager are need to pass parameter into constructor too. What if we remove the PluginManager and the adapter service ? |
@Ocramius please check my branch commit diff samsonasik@3e798ae , if it is ok, then I will submit a PR .... Thank you. |
@samsonasik that's sadly not ok until 3.x, as you are removing functionality. It may be acceptable, but a quick search on usage of that plugin manager may be needed first. Ping @weierophinney is the breakage acceptable in 2.x for you? |
Whoops, sorry, closed by mistake. |
I've got the solution for it by passing 2 parameter into $this->getServiceLocator()
->get('PaginatorPluginManager')->get('dbselect', array($select, $adapter)); But as @weierophinney said that "newInstanceArgs" is no longer used, so, @Ocramius how about changing return new \Zend\Paginator\Adapter\DbSelect(
$this->creationOptions[0],
$this->creationOptions[1],
isset($this->creationOptions[2]) ? : null
); ? |
…with pass creationOptions
👍 |
@samsonasik thanks! |
…with pass creationOptions
Handled in #6574 |
…h exact class with pass creationOptions
…emoving redundant docblock
…emoving redundant docblock
…ator-factory-should-use-mutable-creation-options' into develop Close zendframework/zendframework#6574 Close zendframework/zendframework#6403
Hello,
I've seen that there is a
Zend\Paginator\Adapter\Service\DbSelectFactory
that use$class->newInstanceArgs($this->creationOptions)
.I've seen the ML for it as @weierophinney statement : http://zend-framework-community.634137.n4.nabble.com/AbstractPluginManager-amp-options-creationOptions-will-not-work-as-newInstanceArgs-td4656077.html#a4656083 that newInstanceArgs is no longer used for plugin architecture.
is it should be removed ? or the factory class
Zend\Paginator\Adapter\Service\DbSelectFactory
should be removed and theZend\Paginator\AdapterPluginManager
should be removed too because the call via$invokableClasses
is not implementable because the adapters ( arrayadapter, nulladapter, etc) passed parameter to the__construct
, and there is no other function to set the parameter instead of__construct
?I created a post on the ML at http://zend-framework-community.634137.n4.nabble.com/Removing-class-gt-newInstanceArgs-this-gt-creationOptions-from-Zend-Paginator-Adapter-Service-DbSeley-td4662167.html , I've subcribed to it but not approved yet.
Thank you.
The text was updated successfully, but these errors were encountered: