1
我有以下schema.yaml:排除在DQL 「未知記錄屬性/相關組件」 加入
Artikel:
connection: doctrine
tableName: artikel
columns:
id:
type: integer(4)
fixed: false
unsigned: true
primary: true
autoincrement: true
bezeichnung:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
Portfolio:
connection: doctrine
tableName: portfolio
columns:
artikel_id:
type: integer(4)
fixed: false
unsigned: true
primary: true
autoincrement: false
markt_id:
type: integer(4)
fixed: false
unsigned: true
primary: true
autoincrement: false
relations:
Artikel:
local: id
foreign: zustand_id
type: many
Portfolio:
local: id
foreign: zustand_id
type: many
我以下(短)action.class.php文件:
$this->unt_cat_list = Doctrine_Query::create()
->from('portfolio p')
->innerJoin('p.Artikel a')
->Where('p.markt_id = ? ', array(3))
->andWhere('a.id = ?', array(8))
->execute();
我follwoing gottoSucccess.php文件:
<?php foreach ($unt_cat_list as $cat_list1): ?>
<a href="<?php echo url_for('shop/category') . '/' . 'id/' . $cat_list1->getMarktId() ?>"><?php echo $cat_list1->getBezeichnung() ?></a>
<?php endforeach; ?>
現在我的問題:我想要顯示的列「Bezeichnung」(這我ans:description,所以它是正常的文字)。錯誤是來了一句:
未知記錄屬性/相關組件「bezeichnung」的「投資組合」
它正在與該陣列(3)和(8),因爲條目在db中存在,所以symfony正在加入,對嗎?
如何列出「Bezeichnung」列?有人能幫助我嗎?
親愛的GregOire,非常感謝!它正在工作,我現在不瞭解課程。坦克一個批次! – craphunter 2011-05-22 17:43:10
Bitteschön:-) – greg0ire 2011-05-22 17:44:19