Reputation: 21
I keep getting: Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references.
This happens when I include data for 'asset' in the 'Upload' table in my fixture.
See part of the schema.yml below:
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
Here's part of the Fixture:
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
This happens when I include data for 'asset' in the 'Upload' table in my fixture Does anyone have an idea about this 'Couldn't call Doctrine_Core::set(), second argument...' problem?
Upvotes: 2
Views: 2080
Reputation: 12352
Check the case of the names. Your relation is named "Asset"
and you use "asset"
in fixtures. I had similar problem and it was the problem of the case of the letters.
Upvotes: 0
Reputation: 10413
Try:
Upload:
Upload_1:
asset: [sp_asset1]
Upload_2:
asset: [sp_asset2]
Upvotes: 2