PHP Classes
elePHPant
Icontem

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 (8 years ago) RSS 2.0 feedNot enough user ratingsTotal: 648 All time: 4,721 This week: 894Up
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.

Picture of Roy Yu
Name: Roy Yu <contact>
Classes: 1 package by
Country: United States United States

Details
In this package, there are 5 files

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

Introduction to SPL
- ArrayList.class.php

Demo
- Movie.class.php
- demo.php

Note
====
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  
 0%
Total:648
This week:0
All time:4,721
This week:894Up
User Comments (1)
Really Good my dear friend.
6 years ago (ebyjane)
77%StarStarStarStar