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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 47 - 20 = ?

 
 [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.