1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/manual/codes/Working with objects - Component overview - Collection - Introduction.php
2007-02-23 20:57:38 +00:00

19 lines
405 B
PHP

<?php
$conn = Doctrine_Manager::getInstance()
->openConnection(new PDO("dsn", "username", "pw"));
// initalizing a new collection
$users = new Doctrine_Collection($conn->getTable('User'));
// alternative (propably easier)
$users = new Doctrine_Collection('User');
// adding some data
$coll[0]->name = 'Arnold';
$coll[1]->name = 'Somebody';
// finally save it!
$coll->save();
?>