Skip to content

Instantly share code, notes, and snippets.

@davidreuss
Created May 7, 2009 20:38
Show Gist options
  • Save davidreuss/108347 to your computer and use it in GitHub Desktop.
Save davidreuss/108347 to your computer and use it in GitHub Desktop.
<?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