RedBeanPHP

easy ORM for PHP

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)



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 Disqus

page generated in 0.0058519840240479 sec.