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

21 lines
294 B
PHP
Raw Normal View History

2006-07-24 01:08:06 +04:00
<?php
$user = $conn->create("User");
2006-07-24 01:08:06 +04:00
// alternative way:
$table = $conn->getTable("User");
2006-07-24 01:08:06 +04:00
$user = $table->create();
// the simpliest way:
$user = new User();
// records support array access
$user["name"] = "John Locke";
// save user into database
$user->save();
?>