RedBeanPHP

easy ORM for PHP

Prefix

In RedBeanPHP 3.0 this feature is no longer supported. RedBeanPHP offers advanced tools for formatting database tables. However if all you want is a simple table prefix there is a one-command-way to do this. If you want to prefix tables in your database, use the prefix function:


    R
::prefix('cms_');

From now on all tables generated by RedBeanPHP will be prefixed with 'cms_'. This makes it possible to use the same database for multiple systems. Because of this the prefix is actually tied to the query writer and the toolbox. This means that if you work with multiple toolboxes or databases you have to use the prefix() command for each one of them. However this seems quite an unlikely scenario to me. Note that I consider database sharing a bad practice. I recommend to use database sharing only in situations where you try to integrate multiple different systems that need to interact with eachother closely.

For more information on advanced table formatters, please consult the chapter about Bean Formatting

This feature is available since RedBeanPHP 2.2+



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.0057551860809326 sec.