1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/codes/Basic Components - Collection - Introduction.php

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();
?>