3 ms·
Perhaps the problem the OP is referring to is code like foreach($things as $thing) { $thing->setValue('new value'); } and then looping through
by blowski 11y ago
Perhaps the problem the OP is referring to is code like
foreach($things as $thing) {
$thing->setValue('new value');
}
and then looping through 10000 rows to do that, instead of using an UPDATE query.
I think the best criticism of ActiveRecord (and ORM in general) is performance, but it's only relevant on medium-to-large websites. It is a fantastic design pattern for prototyping, and good enough for production on small-to-medium websites as long as there are caching layers above it.