public function updateAuction($id)
{
$AuctionsTable = Doctrine_Core::getTable('auctions');
$auction = $AuctionsTable->find($id);
$auction->ends_at += 10;
$auction->save();
}
I’m using Doctrine to get a record from the database.
I need to increase number of seconds on this records ends_at column, which is a date type.
+= of course didn’t work. What is the quickest way to add, let’s say, 10 seconds to ends_at variable? And having handled all the other nuisances that might appear (59 + 10 = 69 seconds).
Perhaps I should use mysql’s addtime() function? But is that implemented with Doctrine? Didn’t find anything about addtime() on doctrine.
1 Answer