replacing propel files

This commit is contained in:
Naomi Aro 2011-06-21 15:40:40 +02:00
parent e803b76fcf
commit 5f562b94ca
5 changed files with 194 additions and 2 deletions

View file

@ -0,0 +1,19 @@
<?php
class Common {
public static function setTimeInSub($row, $col, $time)
{
$class = get_class($row).'Peer';
$con = Propel::getConnection($class::DATABASE_NAME);
$sql = 'UPDATE '.$class::TABLE_NAME
. ' SET '.$col.' = :f1'
. ' WHERE ' .$class::ID. ' = :p1';
$stmt = $con->prepare($sql);
$stmt->bindValue(':f1', $time);
$stmt->bindValue(':p1', $row->getDbId());
$stmt->execute();
}
}