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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.