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

Assigned to Alexander due to Zend_Pfd relation

Postponed to post-1.0 period

Is there any Idea when this is going to be implemented ??

I see it's an important feature.

I think it should be done as one of the first Zend_Pdf improvements.

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.

Updating Fix Version to follow issue tracker conventions.