public function execute()
 {
     if (!$this->getParameter('in_filtro')) {
         $q = Doctrine_Query::create()->from($this->getParameter('in_clase'));
     } else {
         $q = Doctrine_Query::create()->from($this->getParameter('in_clase'))->where($this->getParameter('in_filtro'));
     }
     $objs = $q->execute();
     $xml = '<list>';
     foreach ($objs as $obj) {
         $xml .= UtilPsdf::objInstanceToXml($obj);
     }
     $xml .= '</list>';
     $this->setParameter('out_lista', $xml);
     $this->setParameter('out_cantidad', count($objs));
 }
 public function resume($request)
 {
     // Vuelvo a instanciar lista del parametro
     $xml = $this->getParameter('in_lista');
     $clase = $this->getParameter('in_clase');
     // Opcional
     $obj = UtilPsdf::objXmlToInstance($xml);
     if ($obj) {
         // Edicion! Instancio la clase form con el objeto
         $formClassName = get_class($obj) . 'Form';
         $form = new $formClassName($obj);
     } else {
         // Nuevo! Instancio la clase vacía, pero 1ro me valgo del parametro clase si lo tuviera
         if (!$clase) {
             $this->setError('No se pudo determinar la clase a utilizar en el patron');
             return false;
         }
         $formClassName = $clase . 'Form';
         $form = new $formClassName();
         $obj = $form->getObject();
     }
     $fields = $request->getParameter($form->getName());
     // remove CSRF token
     //unset($fields[$form->getCSRFFieldName]);
     foreach ($fields as $key => $value) {
         if (isset($obj->{$key})) {
             if (ucfirst($key) != 'Id' and $obj->{$key} != $value) {
                 $obj->{$key} = $value;
             }
         }
     }
     die('');
     /* La forma en que trata symfony la grabacion desde el formulario:
        $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
        if ($form->isValid()) {
            $obj = $form->save();
        } */
     // Vuelvo a convertir a xml
     $xml = '<list>';
     $xml .= UtilPsdf::objInstanceToXml($obj);
     $xml .= '</list>';
     // Seteo parametro de retorno
     $this->setParameter('out_lista', $xml);
 }