我在调用propel
中的一个类时遇到此Uncaught错误致命错误:未捕获错误:在C:\ Apache24 \ htdocs \ archivedb \ articlesOverview.php:37
中找不到类'Archivedb \ Archivedb \ AbstractQuery'
我很惊讶的原因是,它实际上像我正在调用的所有其他类一样退出。
这是我的php代码:
<?php
use Archivedb\Archivedb\AbstractQuery;
use Archivedb\Archivedb\ArticleQuery;
use Archivedb\Archivedb\TypeofarticleQuery;
require_once 'conf/config.php';
require_once 'default.php';
if( !empty($_GET['magid'] && $_GET['year'] && $_GET['issue'] &&
$_GET['magName'])){
$magazineId = $_GET['magid'];
$year = $_GET['year'];
$issue = $_GET['issue'];
$articlesArray = array();
$articles = ArticleQuery::create()
->filterByMagazineId( $magazineId )
->filterByYear($year)
->distinct()
->filterByIssue($issue)
->find();
foreach ($articles as $article) {
$articlesArray[] = $article->toArray();
}
}
$typeofarticlesArray = array();
$types = TypeofarticleQuery::create()
->find();
foreach ($types as $type) {
$typeofarticlesArray[] = $type->toArray();
}
$abstract = AbstractQuery::create()
->filterByMagazineId($magazineId)
->filterByYear($year)
->distinct()
->filterByIssue($issue)
->find();
$smarty->assign('issueAbstract', $abstract->getIssueAbstract());
$smarty->assign('magazineName', $_GET['magName']);
$smarty->assign('magid', $magazineId);
$smarty->assign('types', $typeofarticlesArray);
$smarty->assign('year', $year);
$smarty->assign('issue', $issue);
$smarty->assign('articles', $articlesArray);
$smarty->display('views/allArticlesOverview.tpl');
在这里,除了AbstractQuery类之外,所有类都被调用并且正常工作。 我最近更改了我的schema.xml以添加这个新表,我之前已经完成了其他表,但从未遇到过这个问题。 谁能发现问题是什么?
这是schema.xml中的表格:
<table name="abstract" idMethod="native" phpName="Abstract" nameSpace="Archivedb">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="issue_abstract" phpName="IssueAbstract" type="LONGVARCHAR" />
<column name="year" phpName="Year" type="INTEGER" size="11" />
<column name="issue" phpName="Issue" type="VARCHAR" size="255" />
<column name="magazine_id" phpName="MagazineId" type="INTEGER" size="11" />
<foreign-key foreignTable="magazine" name="fk_abstract_magazine1" onDelete="none" onUpdate="none">
<reference local="magazine_id" foreign="id"/>
</foreign-key>
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
<parameter name="Charset" value="utf8mb4"/><parameter name="Collate" value="utf8mb4_general_ci"/>
</vendor>
</table>