Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-873

Update Execute Params do not persist


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
    • Environment:
      LAMP php5.2.6 Symfony 1.4


      I have been trying to update numerous records with the one doctrine_query object (which could be my problem) and passing the query execute params to persist to the dbase. eg

      $q = Doctrine_Query::create()
      ->update('TdPackageType pt')
      ->set('pt.name', '?')
      ->set('pt.group_type_id', '?')
      ->where('pt.id = ?')

      Then iterating over an array of values, passing the required values to the execute method eg
      foreach($foobars as $foobar) {
      $q->execute(array($foobar[0], $foobar[1], $foobar[2]));

      I thought this the best way by creating only the one query instance and then assigning the vars as required. Trouble being, the data did not persist? I had no errors returned from Doctrine - eg I had the correct number of matched params - but the update would not update. To move on I ended up instantiating a new query object each time I iterated over my array of data values. eg

      foreach($foobars as $foobar) {

      $q = Doctrine_Query::create()
      ->update('TdPackageType pt')
      ->set('pt.name', '?', $foo[0])
      ->set('pt.group_type_id', '?', $foo[1])
      ->where('pt.id = ?', $foo[2])


      The values did then persist correctly to the dbase? Am I missing something really fundamental here? eg I would have thought the first code struct was a much better design to re-use the one query object. Or is it as silly as me not adding a hydration method to the execute method?

      Any all help appreciated.


        There are no comments yet on this issue.


          • Assignee:
            guilhermeblanco Guilherme Blanco
            kylerclarke Kyle Clarke
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: