Created
May 7, 2009 20:38
-
-
Save davidreuss/108347 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connection = new PDO($dsn); | |
// 1. | |
$persons = new Table($connection, 'persons'); | |
$joe = $table->createRow(array('name' => 'Joe')); | |
$persons->save($joe); | |
// 2. | |
$person = array( | |
'name' => 'Hello world!', | |
'age' => 18 | |
); | |
// Or: | |
// $person = new stdclass(); | |
// $person->name = 'Hello world!'; | |
// $person->age = 18; | |
$persons = new Persons($connection); | |
$persons->save($person); | |
$persons->findByLastname(new ORM_Condition(), 'Jensen'); | |
// 3. | |
// ... hm? | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment