1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Connection - Flushing the connection.php

15 lines
398 B
PHP

Creating new record (database row) is very easy. You can either use the Doctrine_Connection::create() or Doctrine_Table::create()
method to do this or just simple use the new operator.
<code type="php">
$user = new User();
$user->name = 'Jack';
$group = $conn->create('Group');
$group->name = 'Drinking Club';
// saves all the changed objects into database
$conn->flush();
</code>