1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/manual/codes/Working with objects - Component overview - Collection - Introduction.php

19 lines
405 B
PHP
Raw Normal View History

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