Ah, I see my problem, I had accidentally extended the toArray method when playing with the SPL stuff. Thanks.

On 4-Mar-08, at 9:54 AM, Matthew Weier O'Phinney wrote:

-- Jeffrey Sambells <[EMAIL PROTECTED]> wrote
(on Tuesday, 04 March 2008, 09:23 AM -0500):
Hello,

I'd like to pass the result of a database query into the Zend_Form
isValidPartial() method to pre-populate a form and analyze errors if
applicable. Something like

$rowset = $this->_table->find( '1' );
$row = $rowset->current();

$form->isValidPartial( $row );

However this isn't allowed as the isValidPartial() uses the "array" type hint and $row is an object. I've tried using SPL to implement array access but that doesn't seem to change anything. Is there a way to do this or do I
have to convert the object to an array first?

You need to change it to an array first, which, fortunately,
Zend_Db_Table_Row_Abstract allows:

   $form->isValidPartial($row->toArray());

--
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to