2006-08-30 15:37:09 +04:00
|
|
|
<?php
|
2006-08-31 02:43:11 +04:00
|
|
|
$conn = Doctrine_Manager::getInstance()
|
|
|
|
->openConnection(new PDO("dsn", "username", "pw"));
|
2006-08-30 15:37:09 +04:00
|
|
|
|
2006-08-31 02:43:11 +04:00
|
|
|
// initalizing a new collection
|
|
|
|
$users = new Doctrine_Collection($conn->getTable('User'));
|
|
|
|
|
|
|
|
// alternative (propably easier)
|
|
|
|
$users = new Doctrine_Collection('User');
|
|
|
|
|
|
|
|
// adding some data
|
2006-08-30 15:37:09 +04:00
|
|
|
$coll[0]->name = 'Arnold';
|
|
|
|
|
|
|
|
$coll[1]->name = 'Somebody';
|
|
|
|
|
2006-08-31 02:43:11 +04:00
|
|
|
// finally save it!
|
2006-08-30 15:37:09 +04:00
|
|
|
$coll->save();
|
|
|
|
?>
|