Issues

ZF2-239: "__clone method called on non-object" error when setting selectResultPrototype in setup() function of class extending \Zend\Db\TableGateway\AbstractTableGateway

Issue Type: Bug Created: 2012-03-27T06:10:08.000+0000 Last Updated: 2012-05-24T07:58:58.000+0000 Status: Resolved Fix version(s): Reporter: Chris Schreiber (scribles) Assignee: Ralph Schindler (ralph) Tags: - Zend\Db

  • zend_db

Related issues: - ZF2-235

Attachments:

Description

Creating a RowGateway object as a dependency of ResultSet object to set selectResultPrototype property during the construction of a TableGateway object causes the following error:

"Fatal error: __clone method called on non-object in /var/www/pyratepunx/vendor/ZendFramework/library/Zend/Db/TableGateway/TableGateway.php on line 382"

The problem is the RowGateway constructor tries to clone the TableGateway object which tries to clone its selectResultPrototype property which is what we are trying to set and it creates a bit of a chicken and the egg situation.

The following code reproduces the error:

selectResultPrototype = new \\Zend\\Db\\ResultSet\\ResultSet(new MyRowGateway($this, 'id')); } } $myTable = new MyTableGateway(); ?>

Comments

Posted by Vitalii (duken) (duken) on 2012-03-27T06:57:24.000+0000

It's the same. And I guess that patch resolve and this.

Posted by Vitalii (duken) (duken) on 2012-05-24T07:58:58.000+0000

Fixed in beta4

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts