- General
- Articles
- Legacy
- Misc
- Third Party
- Who uses RedBeanPHP
- Personal
Default Bean Formatter
The default bean formatter class is a convenience class. It has default implementations for all of the IBeanFormatter interface methods. Instead of writing every implementation yourself you can simply extend this method and override what's necessary:
class MyBeanFormatter extends RedBean_DefaultBeanFormatter {
public function getAlias($field) {
if ($field=='student') return 'person';
return $field;
}
..leave the rest...
}
Also see: Default Schema Conventions (for use with legacy databases)
Tweet
User contributed notes. Please use the comment section to provide tips, notes and examples. To ask for support or to provide feedback use the forum. For bug reports use Github Issue Tracker.
Site comments powered by Disquspage generated in 0.0058519840240479 sec.