3

I've seen on SO that you can do multiple inserts without having to do them in a loop, with the createRowset and createRow methods.

My problem is, that I'm not sure in which class the createRowset method is defined. I have the following code, which fails with an 500 internal error:

$twitterUsersModel = new TwitterUsers($this->db_adapter);
$rowset = $twitterUsersModel->createRowset(); // this is the line that fails
foreach ($data as $d) 
{
    $row = $twitterUsersModel->createRow($d);
    $rowset->addRow($row);
}
$rowset->save();

My TwitterUsers class extends the Zend_Db_Table_Abstract class, which (as far as I can tell) doesn't have a createRowset method (just tested with extending Zend_Db_Table, still not working). Is there any other way to do this from a Zend_Db_Table_Abstract extending class?

Eduard Luca
  • 6,514
  • 16
  • 85
  • 137

1 Answers1

5

Its defined nowhere actually. This feature is not yet implemented in Zend framework. However this is proposed as a new feature in Zend Framework Issue tracker.

http://framework.zend.com/issues/browse/ZF-2322

Vote for it, to get the feature sooner.

Raj
  • 22,346
  • 14
  • 99
  • 142
  • I see, so I'll have to do my inserts in a loop afterall :( just sad that it doesn't offer this kind of stuff. Thank you! – Eduard Luca Dec 15 '11 at 10:19