1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Record - Updating records.php

17 lines
452 B
PHP
Raw Normal View History

2007-04-14 01:49:11 +04:00
Updating objects is very easy, you just call the Doctrine_Record::save() method. The other way
(perhaps even easier) is to call Doctrine_Connection::flush() which saves all objects. It should be noted though
that flushing is a much heavier operation than just calling save method.
2007-04-14 01:49:11 +04:00
<code type="php">
$table = $conn->getTable("User");
$user = $table->find(2);
if($user !== false) {
$user->name = "Jack Daniels";
$user->save();
}
</code>