Permalink
Browse files

updating samples

  • Loading branch information...
1 parent 1dcc880 commit b8c8d2c148ef3a7567fb32a5d61e813255fa598b @fgrehm committed Nov 5, 2009
@@ -1,5 +1,7 @@
<?php
+namespace outlet\samples\model;
+
class User {
public $ID;
public $Username;
@@ -1,4 +1,4 @@
<?php
-set_include_path(realpath(dirname(__FILE__).'/../../../classes') . ';' . get_include_path());
-require_once 'outlet/Outlet.php';
-Outlet::addConfig(include 'outlet-config.php');
+
+require_once __DIR__.'/../../../classes/outlet/Outlet.php';
+outlet\Outlet::addConfig(include 'outlet-config.php');
@@ -1,13 +1,13 @@
<?php
require_once 'config.php';
-require '../classes/User.php';
+require __DIR__.'/../classes/User.php';
-$session = Outlet::openSession();
+$session = outlet\Outlet::openSession();
// Create
echo "Creating...\n";
-$user = new User;
+$user = new outlet\samples\model\User;
$user->ID = 1;
$user->Username = 'Test user';
$session->save($user)
@@ -16,7 +16,7 @@
// Load
echo "Loading...\n";
-$user = $session->load('User', 1);
+$user = $session->load('User', 1); // No need to specify namespaces
echo "Loaded\n";
// Update
@@ -1,14 +1,14 @@
<?php
return array(
'connection' => array(
- 'dsn' => 'sqlite:test.sq3',
+ 'dsn' => 'sqlite:'.__DIR__.'/test.sq3',
'dialect' => 'sqlite'
),
'proxies' => array(
'autoload' => true
),
'classes' => array(
- 'User' => array(
+ 'outlet\samples\model\User' => array(
'table' => 'users',
'props' => array(
'ID' => array('id', 'int', array('pk'=>true, 'autoIncrement'=>true)),
Binary file not shown.
@@ -1,6 +0,0 @@
-<?php
-
-//namespace outlet\tests\model;
-//
-//class Project_OutletProxy extends Project implements \OutletProxy {};
-//class Bug_OutletProxy extends Bug implements \OutletProxy {};

0 comments on commit b8c8d2c

Please sign in to comment.