Propel (PHP ORM), 基本用法 returns NULL for all (not empty) tables and columns

Propel (PHP ORM), Basic usage returns NULL for all (not empty) tables and columns

我正在使用 Propel ORM,我设置了必须来自 Propel 文档的所有内容。我有 tables,当我回显某些 Table 行的结果时,结果只是 NULL,所有内容都是 NULL。 当然这些tables/rows不是空的。它适用于标准查询。 问题是也没有错误,这就是为什么我找不到解决方案并且无法解释问题的原因,就像我想要的那样。 我是 Propel 的新手,想使用它。请,如果有经验的人可以帮助我。 我正在使用 MySQL。 代码是标准的:

 // setup the autoloading
 require_once '../vendor/autoload.php';

 // setup Propel
 require_once '../vendor/bin/generated-conf/config.php';

 $author = new Authors();

 echo '<pre>';
 var_dump($author);
 echo '</pre>';

table不为空。

http://propelorm.org/Propel/documentation/08-logging.html

您将从日志中获取有关错误的更多信息。

$author = new Authors();

未检索 Authors 中的所有行(table 指定的作者或作者?)。为此,您需要使用查询:

$q = \AuthorsQuery::create();
$authors = $q->find();
foreach ($authors as $author) {
    var_dump($author->toArray());
}