Doctrine 1
  1. Doctrine 1
  2. DC-743

Incompatibilty between fixture import and accessors extends

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • 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?

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Brice Favre
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: