Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Paul C  >  PersistentObject  >  test.php  >  Download  
File: test.php
Role: Unit test script
Content type: text/plain
Description: Demo
Class: PersistentObject
Encapsulates a database table row in a class
Author: By
Last change:
Date: 2003-07-02 13:08
Size: 767 bytes
 

Contents

Class file image Download
<html>
<head>
    <title>PersistentObject Testpad</title>
</head>
<body>

<?php
/**
  * @Author:  Paul Campbell <paul@campbell-multimedia.com>
  * @Company: Campbell Multimedia <www.campbell-multimedia.com>
  * @Date:    2nd July 2003
  */

require_once( "config.php" );
$c = new CustomerPlain();
$c->load$db);
print 
"<p>Just a load...</p>";
$c->render($db);

$c->set"name""Different Name" );
$c->commit($db);
$c->load$db);

print 
"<p>After modification, commit() and load()</p>";
$c->render();

$c = new CustomerPlain();
$c->create("NewCustomer");

$c->commit($db);
$c->load$db $c->id );
print 
"<p>A new customer, inserted into the DB as a new row, loaded and rendered.</p>";
print 
"<p>New CustomerID = $c->id</p>";
$c->render();


?><br /><?



?>