protected function addSortCriteria($c)
 {
     if ($sort_column = $this->getUser()->getAttribute('sort', null, 'sf_admin/historico_documento/sort')) {
         if ($sort_column == 'usuario') {
             $c->addJoin(HistoricoDocumentoPeer::ID_USUARIO, UsuarioPeer::ID_USUARIO, Criteria::LEFT_JOIN);
             if ($this->getUser()->getAttribute('type', null, 'sf_admin/historico_documento/sort') == 'asc') {
                 $c->addAscendingOrderByColumn(UsuarioPeer::NOMBRE);
             } else {
                 $c->addDescendingOrderByColumn(UsuarioPeer::NOMBRE);
             }
         } else {
             $sort_column = HistoricoDocumentoPeer::translateFieldName($sort_column, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_COLNAME);
             if ($this->getUser()->getAttribute('type', null, 'sf_admin/historico_documento/sort') == 'asc') {
                 $c->addAscendingOrderByColumn($sort_column);
             } else {
                 $c->addDescendingOrderByColumn($sort_column);
             }
         }
     }
 }
 /**
  * Sets a field from the object by name passed in as a string.
  *
  * @param      string $name peer name
  * @param      mixed $value field value
  * @param      string $type The type of fieldname the $name is of:
  *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  * @return     void
  */
 public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
 {
     $pos = HistoricoDocumentoPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
     return $this->setByPosition($pos, $value);
 }