[DC-743] Incompatibilty between fixture import and accessors extends Created: 16/Jun/10 Updated: 22/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 1 |
| Component/s: | Data Fixtures, Import/Export |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Brice Favre | Assignee: | Jonathan H. Wage |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Environment: |
Window, PHP5, Symfony |
||
| Description |
|
Hello, I had a problem when i try to import data with an extended accessors when i try to insert a content with a relation. I discovered this problem in symfony. For example, here is my table :
News:
tableName: ne_news
columns:
id: { type: integer(4), primary: true, autoincrement: true }
author_id: { type: integer(4), notnull: true }
name: { type: string(255) }
description: { type: text }
relations:
author: { class: sfGuardUser, onDelete: NULL, local: author_id, foreign: id, foreignAlias: sfGuardUser }
And the fixture :
SfGuardUser:
sadmin:
username: admin
password: admin
is_super_admin: true
author1:
username: myname
News:
News1:
name: Test 1
description: Description of news 1
author: author1
I import it with symfony doctrine:data-load and it works. If i add a news.class.php and extends the autogenerated class it fails.
public function setAuthor($v)
{
//__log('extending setter');
return $this->_set('author', $v);
}
WhenDoctrine_Data_Import finds the setAuthor function, it wont transform author1 in object so $v will be a string, not an sfGuardUser object. What do you think? Is a common behavior, how can i extends my accessor? |
| Comments |
| Comment by ryan [ 22/Jul/11 ] |
|
this is the same issue as DC-735 |