PHP Classes

Object dynamic generation: Create model classes dynamically

Recommend this page to a friend!
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2008-01-31 (11 years ago) RSS 2.0 feedNot enough user ratingsTotal: 651 All time: 4,832 This week: 334Up
Version License PHP version Categories
dynamicobject 1.0GNU General Publi...5.0PHP 5, Data types
Description Author

This package can be used to add model classes dynamically.

A base abstract class provides the default implementation of property setter and getter functions.

Concrete model classes are derived from the base abstract class.

Objects of a model class can be created either directly instantiating the class or calling a factory class that takes care of automatically loading the class from a directory where model class files reside.

Name: Roy Yu <contact>
Classes: 1 package by
Country: United States United States
Age: ???
All time rank: 2865361 in United States United States
Week rank: 724 Up74 in United States United States Up


In this package, there are 5 files

Core classes
- Model.class.php
- Factory.class.php

Introduction to SPL
- ArrayList.class.php

- Movie.class.php
- demo.php

You are free to modify and use the codes, but make sure you give credit to the author, thanks.

Stuff to think
Please look at demo.php  first and try to imagine how this works before you look at the core classes.
(1) Guess - What is inside the Movie class ?
(2) Look at the different ways of creating object.

-- Roy
  Files folder image Files  
File Role Description
Files folder imageclass (2 files)
Files folder imagemodel (2 files)
Accessible without login Plain text file demo.php Example Entry points of this demo, show how to use the classes
Accessible without login Plain text file readme.txt Doc. Readme First

  Files folder image Files  /  class  
File Role Description
  Plain text file ArrayList.class.php Class Simple Demo on using SPL
  Plain text file Factory.class.php Class Core classes - provide different ways to instantiate an object

  Files folder image Files  /  model  
File Role Description
  Plain text file Model.class.php Class Core classes - give the subclass ability to be dynamically created
  Plain text file Movie.class.php Class Demo - a subclass extending Model core class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,832
This week:334Up
User Comments (1)
Really Good my dear friend.
9 years ago (ebyjane)