2010-07-20 39 views
2

我一直在收到:無法調用Doctrine_Core :: set(),第二個參數應該是Doctrine_Collection的一個實例,一對多參考。需要幫助:無法調用Doctrine_Core :: set()... symfony 1.4 fixture

當我在'fixture'的'Upload'表中包含'asset'的數據時會發生這種情況。

請參見下面的schema.yml中的一部分:

  
detect_relations: true 
options: 
    collate: utf8_general_ci 
    charset: utf8 
    type: InnoDB 

Asset: 
    actAs: { Timestampable: ~ } 
    columns: 
    asset_id: 
     type: integer 
     primary: true 
     notnull: true 
     autoincrement: true 
    asset_type_id: 
     type: integer 
     notnull: true 
    user_id: 
     type: integer(4) 
     notnull: true 
    name: 
     type: string(45) 


Upload: 
    actAs: { Timestampable: ~ } 
    columns: 
    upload_id: 
     type: integer 
     primary: true 
     notnull: true 
     autoincrement: true 
    asset_id: 
     type: integer 
     notnull: true 
    relations: 
    Asset: 
     class: Asset 
     local: asset_id 
     foreign: asset_id 
     foreignAlias: Assets 
     type: many 
     foreignType: one 

這裏的燈具的一部分:

 
Asset: 
    sp_asset1: 
    AssetType: Spain 
    sfGuardUser: User_1 
    name: The great Spanish song 
    Category: Category_3 
    description: The best Spanish Thing 
    preview: http://www.google.com/sample.mp3 
    sp_asset2: 
    AssetType: British 
    sfGuardUser: User_1 
    name: The best mountains scok 
    Category: Category_3 
    description: A great example of British 

## the problem happens below ## 
Upload: 
    Upload_1: 
    asset: sp_asset1 
    Upload_2: 
    asset: sp_asset2 

這發生在我包括在「上傳」表「資產」數據我的夾具 有沒有人有關於這個'無法調用Doctrine_Core :: set(),第二個參數...'的想法?

回答

2

嘗試:

Upload: 
    Upload_1: 
    asset: [sp_asset1] 
    Upload_2: 
    asset: [sp_asset2] 
0

檢查名稱的大小寫。您的關係被命名爲"Asset",並且您在燈具中使用"asset"。我有類似的問題,這是字母的問題。