3 ms·
Some light weight ORMs do not require you to define all the properties ahead of time. They pull the field names from the table and generate the model record on
by hparadiz 2y ago
Some light weight ORMs do not require you to define all the properties ahead of time. They pull the field names from the table and generate the model record on the fly for you. This generally lets you prototype really fast. Laravel's Eloquent is known to do this. It's also useful for derived SQL fields when you use custom queries or join from other tables. Also kinda fun to do it for properties backed by a method. As in $record->isDirty will run isDirty() under the hood for you. All these things can be documented with PHPDoc and static analyzers handle it just fine.
- hamandcheese 2y agoIs it possible to dynamically define methods in PHP?
- hparadiz 2y agoYes.