在 Redbean 中给定一个 link bean table 这个名字有规则吗?

Is there a rule to the name a link bean table gets given in Redbean?

我有一些由 Redbean 构建的 link bean table - 每个都是由以下类型的代码创建的;

//generates tag_video table
$tags = R::findAll('tag');
$video = R::dispense('video');
$video->sharedTag = $tags;
R::store($video);

//generates image_tag table
$image = R::dispense('image');
$image->sharedTag = $tags;
R::store($image);

//generates document_tag table
$document = R::dispense('document');
$document->sharedTag = $tags;
R::store($document);

我的大多数 link bean table 都被命名为 image_tagdocument_tag。但是我也有tag_video,这是个问题。我更喜欢 video_tag.

我希望能够预测 link bean table 名称,因为当我直接查询数据库而不是使用 ORM 时,我想在 JOIN 中使用它们。

有规定吗?也许是字母顺序?我可以坚持 'parent' 对象类型在 table 名称中排在第一位吗?

我后来发现 link 表总是按字母顺序命名的。

这是开发者的回复。

The tables are always named alphabetically. Unfortunately given the fact that RB strives to be zero-conf, it's not recommended to enforce a naming convention. RedBeanPHP allows you to change most of the schema policy rules but I recommend not to do this because it will break things and defeat the purpose of RB althoghether.

如果您不想不断尝试记住这个 bean 到底是什么名字,table、R::xdispense

因为这样您就可以根据需要使用下划线和结构化数据;同时仍然使用基本的 CRUD 功能就好了。