情况如下:
父母:
namespace Base;
/** @Entity @Table(name="section") */
class Section extends Skeleton {
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
protected $id;
/** @Column(length=256) */
protected $title;
/** @Column(length=256) */
protected $stylesheet;
}
儿童:
namespace Base2;
use BaseSection AS BaseSection;
/** @Entity @Table(name="tbl_section") */
class Section extends BaseSection {
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
protected $id;
/** @Column(length=256) */
protected $title;
/** @Column(length=256) */
protected $stylesheet;
}
当我试图从数据库中检索一个科时,就会发现一个错误:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column t0.id
in where clause in /var/www/eage_new_zf/library/Doctrine/DBAL/Connection.php
on line 567 Call Stack #TimeMemoryFunctionLocation 10.0004489704{main}(
)../index.php:0 20.03193296632Zend_Controller_Front->dispatch( ???, ???
)../index.php:27 30.04574505172Zend_Controller_Dispatcher_Standard->dispatch(
object(Zend_Controller_Request_Http)[39], object(Zend_Controller_Response_Http)[40]
)../Front.php:954 Variables in local scope (#3)
它试图执行的问题是:
SELECT
t1.id AS id2,
t1.title AS title3,
t1.stylesheet AS stylesheet4
FROM
tbl_section t1
WHERE
t0.id = ?
t0在技术上没有定义,这是正确的,我有错误。 但是,如何解决这一问题? 难道这在理论2中是一种 b吗? 或者,我做了一些错误的事情。