Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.4

Request #4665 Support for extended classes
Submitted: 2005-06-23 07:38 UTC
From: dan at yes dot lt Assigned:
Status: Verified Package: Spreadsheet_Excel_Writer
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2009-08-12 03:45 UTC
Package:
Bug Type:
Summary:
From: dan at yes dot lt
New email:
PHP Version: Package Version: OS:

 

 [2005-06-23 07:38 UTC] dan at yes dot lt
Description: ------------ Now when extending Spreadsheet_Excel_Writer_Workbook class there is no way to return extended classes for *_Worksheet, *_Format, etc. from ->addWorksheet(), ->addFormat(), etc... I sudgest to add additional parameter for those methods - $className: < function &addWorksheet($name = '') > function &addWorksheet($name = '', $className = '') < function &addFormat($properties = array()) > function &addFormat($properties = array(), $className = '') ... And then reimplement thouse methods to support different classes: < $worksheet = new Spreadsheet_Excel_Writer_Worksheet(... > if (! class_exists($className)) { > $className = 'Spreadsheet_Excel_Writer_Worksheet'; > } > $worksheet = new $className(... > if (! is_a($worksheet, 'Spreadsheet_Excel_Writer_Worksheet')) { > $this->raiseError('Custom class do not extends Spreadsheet_Excel_Writer_Worksheet', 0, PEAR_ERROR_DIE); > } ...and the same for all other classes.

Comments

 [2009-08-12 03:45 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Verified
This would help in getting more specialist classes tied to certain rules into place. Instead of using >$className = ''<, I would default it to the original SEW class.