Hi Simon,
Yup, setting protected $_rowClass = 'Account'; does work. However, I plan on
lazy loading a lot of my definitions so I can do something like:
class Accounts extends Custom_Db_Table_Which_Extends_Zend_Db_Table
implements Custom_Action_Insert_Delete_Authorize
{
public function _setup($config = array())
{
$this->_name = __CLASS__;
$this->setRowClass(
Utility_String_Ucfirst::returnString(
Utility_String_Inflector_Singularize::returnString(
$this->_name)));
parent::_setup($config);
}
}
Really it's six in one and half a dozen in the other, just a personal
preference, seeing how far I can push ZF. Unfortunately, this method didn't
work from my initial tests, bringing us to the problem at hand.
Alas, I do need the custom rowset. I have some methods on the entire
resultset that I'd like to use in the future. (For instance, pagination
utilizing view helpers).
I'd really like if you (or someone) can poke around and see what's going
wrong, if anything. Otherwise my experience during my upgrade has been very
positive.
Thanks! Hope to hear from you soon!
-Ryan
_____
From: Simon Mundy [mailto:[EMAIL PROTECTED]
Sent: March 19, 2007 2:35 PM
To: Ryan Brooks
Cc: [email protected]
Subject: Re: [fw-general] $db->setRowClass & $db->setRowsetClass
Hi Ryan
I had a quick look at your table/row definitions.
This will work:-
class Accounts extends Zend_Db_Table
{
protected $_name = 'accounts';
protected $_rowClass = 'Account';
}
You don't need the extra Rowset definition if there's no specific
functionality you need to add - in most cases the default rowSet class is
adequate.
What puzzles me is that your '$this->setRowClass('Account')' _should_ have
worked. I'll do some digging later to see if anything is awry and post a
JIRA issue if it turns out to be the case.
Cheers
Update:
Now I know I've missed something.
In my debugging process, here's what I did.
Open: Zend/DB/Table/Rowset/Abstract.php
Goto Line: 71
Replace Value of: protected $_rowClass = 'Zend_Db_Table_Row'
With: protected $_rowClass = 'Account'
Have access to Account->helloWorld();
I'll keep digging, I seem to be missing a step along the way.
-Ryan
PS: Undo changes, save. ;)
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com