title: Get and return the ID to execute "edit" action
body: <p>I've a module made using "tabs", each tab call a component in this way:</p>
  
  <pre><code>include_component('logotipo', 'index');
  </code></pre>
  
  <p>Now this is the code for the component:</p>
  
  <pre><code>class logotipoComponents extends sfComponents {
  
      public function executeIndex(sfWebRequest $request) {
          $id_empresa = $this-&gt;getUser()-&gt;getGuardUser()-&gt;getSfGuardUserProfile()-&gt;getIdempresa();
          $this-&gt;sdriving_logotipo = Doctrine_Core::getTable('SdrivingLogotipo')-&gt;createQuery('a')-&gt;leftJoin('a.SdrivingEmpresa e')-&gt;where('e.idempresa = ?', $id_empresa)-&gt;execute();
      }
  
  }
  </code></pre>
  
  <p>And  this is the template <code>_index.php</code>:</p>
  
  <pre><code>&lt;?php if ($sdriving_logotipo-&gt;count() &gt; 0): ?&gt;
      &lt;div class="span3"&gt;
          &lt;span class="gris"&gt;Vista previa&lt;/span&gt;
          &lt;?php echo image_tag('/uploads/' . $sdriving_logotipo[0]-&gt;getArchivo()); ?&gt;
      &lt;/div&gt;
  &lt;?php else: ?&gt;
      &lt;div class="alert alert-block"&gt;
          &lt;h4&gt;&lt;?php echo __('Información!') ?&gt;&lt;/h4&gt;
          &lt;?php echo __('No se ha subido ningún logotipo aún. Haga clic en el botón "Subir nuevo" para crear uno.') ?&gt;
      &lt;/div&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>This code works fine, but I need a bit more. What I need to do here is update logotipo uploading a new one and delete the existent from file system and also from database or just editing the existent record and updating values. Now takes a look at this <code>schema.yml</code>:</p>
  
  <pre><code>SdrivingEmpresa:
    columns:
      idempresa:
        type: integer(4)
        unsigned: true
        primary: true
        autoincrement: true
      idlogotipo:
        type: integer(4)
        unsigned: true
        primary: true
      nombre_empresa:
        type: string(250)
        notnull: true
      ruta_emp:
        type: string(45)
        notnull: true
        autoincrement: false
    relations:
      SdrivingLogotipo:
        local: idlogotipo
        foreign: idlogotipo
        type: one
      SdrivingEmisor:
        local: idempresa
        foreign: idempresa
        type: many
      SdrivingMaquina:
        local: idempresa
        foreign: idempresa
        type: many
      SdrivingOperador:
        local: idempresa
        foreign: idempresa
        type: many
      SdrivingTurno:
        local: idempresa
        foreign: idempresa
        type: many
      SfGuardUserProfile:
        local: idempresa
        foreign: idempresa
        type: many
  
  SdrivingLogotipo:
    columns:
      idlogotipo:
        type: integer(4)
        unsigned: true
        primary: true
        autoincrement: true
      archivo:
        type: string(250)
    relations:
      SdrivingEmpresa:
        local: idlogotipo
        foreign: idlogotipo
        type: many
  </code></pre>
  
  <p>Taking this if I pick the first option then I need to build a query for get the filename from DB and then delete the file from file system, upload the new file and update <code>SdrivingEmpresa</code> table with the new ID for uploaded file. In this case I don't know how to get the ID and where to write the logic for those actions: in <code>protected function processForm(sfWebRequest $request, sfForm $form) { }</code>? in 'doSave($con = null){ }' at <code>SdrivingLogotipoForm.class.php</code>? Where?</p>
  
  <p>Any help?</p>