PHP Classes
Icontem

File: sample.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  TypeSafeStruct  >  sample.php  
File: sample.php
Role: Example script
Content type: text/plain
Description: as the name says
Class: TypeSafeStruct
Manipulate type safe objects
 

Contents

Class file image Download
/**
 * @author Thomas Schaefer
 * @mail scaphare@gmail.com
*/

// classes
include "TypedStruct.class.php";
include "TypeSafeStruct.class.php";
include "SerializeTypedStruct.class.php";

// sample model
include "Model_Objects_Countries.php";

// instantiate
$clsObject = new Model_Objects_Countries;

// add some data
$clsObject->setContinent("Asia");
$clsObject->setCode("ALC");

switch($_GET["format"]){
    case "xml":
        header("content-type:text/xml");
        echo SerializeTypedStruct::toXML($clsObject);        
        break;
    case "sqlInsert":
        echo SerializeTypedStruct::sqlInsert($clsObject,"Countries");
        break;
    default:
        print "<pre>";
        echo $clsObject;
        print "<pre>";
        break;
}

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products