Inicio > Symfony > Consulta de actualización utilizando Propel

Consulta de actualización utilizando Propel

Miércoles, 18 de Marzo de 2009 Henry Vallenilla Dejar un comentario Ir a comentarios

Esta es otra manera de actualizar uno o varios registros usando Propel:

$con = Propel::getConnection();

// select from...
$c1 = new Criteria();
$c1->add(CommentPeer::POST_ID, $post_id);

// update set
$c2 = new Criteria();
$c2->add(CommentPeer::RATING, 5);

___________________________________________________________________________________________________

Si estas una clase Peer:

$con = Propel::getConnection();

// select from...
$c1 = new Criteria();
$c1->add(self::POST_ID, $post_id);

// update set
$c2 = new Criteria();
$c2->add(self::RATING, 5);

BasePeer::doUpdate($c1, $c2, $con);

BasePeer::doUpdate($c1, $c2, $con);
Compartir información en: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • MisterWong
  • Y!GG
  • Webnews
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Ask
  • De.lirio.us
  • Facebook
  • LinkedIn
  • Live-MSN
  • MySpace
  • YahooMyWeb
  • email
  • Google Bookmarks
  • TwitThis
  • YahooBuzz
Categories: Symfony Tags: ,
  1. Sin comentarios aún.
  1. Sin trackbacks aún.