3 ms·
You don't need an ORM, it just helps immensely. Here's a recent error I found, and of course, this is a PHP issue, someone used if(empty()) and the value was a
by calvinmorrison 4y ago
You don't need an ORM, it just helps immensely.
Here's a recent error I found, and of course, this is a PHP issue, someone used if(empty()) and the value was a string "0" . This evaluated to true, causing a function, that builds up inserts from an associative array (functionally equivelant to say, eloquent's Model::create($data)->save()), to insert NULL instead of "0".
Now, we can say that's a php ism, that's just a bug or mistake, but I have found repeated issues like this, especially with legacy PHP code.
Going out the gate with something like Eloquent in Laravel, and showing people patterns, really does help. It helps isolate their mistakes, it gives them rails to ride on.