ZF-1309: Unable to clone Zend_Pdf_Page
Description
This class does not implement __clone() and copying pages fails. There's a hint that page cloning is done via constructor and not is implemented yet:
if ($param1 instanceof Zend_Pdf_Page && $param2 === null && $param3 === null) {
/** @todo implementation */
throw new Zend_Pdf_Exception('Not implemented yet.');
This missing bit is a serious issue if you try to do proper OOP. IMHO copying object belongs to clone keyword and __clone() method. And if it's meant to be done by the constructor then at least __clone() should throw an exception.
Comments
Posted by Thomas Weidner (thomas) on 2007-05-06T09:15:24.000+0000
Assigned to Alexander due to Zend_Pfd relation
Posted by Alexander Veremyev (alexander) on 2007-05-25T02:52:00.000+0000
Postponed to post-1.0 period
Posted by Paul Menheere (paulmenheere) on 2007-08-17T14:55:10.000+0000
Is there any Idea when this is going to be implemented ??
Posted by Alexander Veremyev (alexander) on 2007-08-26T13:51:32.000+0000
I see it's an important feature.
Posted by Alexander Veremyev (alexander) on 2007-08-26T13:52:56.000+0000
I think it should be done as one of the first Zend_Pdf improvements.
Posted by Alexander Veremyev (alexander) on 2007-09-05T07:58:24.000+0000
Done.
Cloning mechanism is not used because we need access to the source object (that's of course possible to do this, but it complicates memory management).
Exception is thrown if clone keyword is used.
Posted by Wil Sinclair (wil) on 2008-01-23T18:42:10.000+0000
Updating Fix Version to follow issue tracker conventions.