gabordemooij / redbean

ORM layer that creates models, config and database on the fly
https://www.redbeanphp.com
2.3k stars 279 forks source link

Added symbol '_' in checkType function #899

Closed Temurumaru closed 2 years ago

Temurumaru commented 2 years ago

This change was made in order to be able to create tables with the '_' symbol in the name.

Lynesth commented 2 years ago

You can use \RedBeanPHP\Util\DispenseHelper::setEnforceNamingPolicy( FALSE ); to be able to name your beans however you want.

Temurumaru commented 2 years ago

оо спасибо просто это по моему это ограничение ни к чему

Lynesth commented 2 years ago

This restriction is not "useless".

Redbean uses underscore to create relationship tables. For example, the table role_user would be the table that link beans from the user table to the role table in a many-to-many relationship. Now we can't have you also create a role_user table by yourself on top of that, right?

So, in order to be consistent and prevent issues, the original creator of Redbean decided to enforce a naming policy for beans. But as mentioned above you can disable it and do whatever you want :)

gabordemooij commented 2 years ago

оо спасибо просто это по моему это ограничение ни к чему

Yes, I understand your reasoning but maybe a better way to look at it is as a little protection for people who are new to RedBeanPHP. As @Lynesth has clarified you can easily turn it off.

Temurumaru commented 2 years ago

Спасибо за такой чудесный Фреймворк :)