I am using RedBeanPHP along with an API I am writing to make calls to an existing Database. Everything works great except some of the tables have underscores in their names. According to RedBean "underscores and uppercase chars are not allowed in type and property names."
When searching for solutions people recommended the use of the function.
R::setStrictTyping(false);
This would override the rules and allow you to dispense a bean such as
$post_points = R::dispense( 'user_points' );
However this appears to be missing in RedBeanPHP 4KS because when I put the SetStringTyping line in I recieve the following error:
Plugin 'setStrictTyping' does not exist, add this plugin using: R::ext('setStrictTyping')
There is no plugin for this.
Is there a workaround for this override? Since I am working with an existing DB schema its not as easy to just change all the table names to conform to RedBeanPHP standards at this point. Nor, as others suggested, just switching to a different system all together such as using Doctrine.
Found out a solution. The check for underscores and uppercase chars only happens in the Facade. By adding this code:
You can then do the following without error.
Cool.
Or you could extend RedBeanPHP\Facade and override dispense function. Then use new wrapper class instead of R static.