我在我的 php 项目中使用教义 ORM 。
我想知道教义如何从数据库中获取对象(其表)?
它是否获取该对象的所有相关连接以及所有相关对象?
假设$author与$article有关联。是否$author = $authorRepository->find($id)
获取文章表?它是否获取该对象的连接的连接?
我在转储 ORM 对象时遇到了这个问题。我看到了它所有的协会标题。例如: $author 的学说转储:
object(stdClass)#1212 (4) {
["__CLASS__"]=>
string(6) "author"
["ID"]=>
int(12)
["num"]=>
int(6059996)
["CreateTimestamp"]=>
int(1316602238)
["articles"]=>
array(3) {
[0]=>
string(7) "article"
[1]=>
string(7) "article"
[2]=>
string(7) "article"
}
}