Don't like ads? PRO users don't see any ads ;-)
Guest

Portable Web Dev

By: a guest on Aug 27th, 2010  |  syntax: PHP  |  size: 1.17 KB  |  hits: 280  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. <?
  3.         /**
  4.          * Project Class
  5.          */
  6.         class Project {
  7.  
  8.                 private static $modelName = "Project";
  9.                 private static $tableName = "project";
  10.                 public static $model_fields = array("id", "name", "description", "type");
  11.                 public static  $all_project_ids = array(3, 5, 9, 11, 16, 24, 38, 112, 215, 222);
  12.                 public $related_project_ids = array(9, 38, 215);
  13.                
  14.                
  15.                 /**
  16.                  * getFields
  17.                  * Return Project fields ($model_fields) items as a CSV sting,
  18.                  * with array order reversed, and all uppercase
  19.                  */
  20.                 public static function getFields() {
  21.                         $details = "";
  22.                         return $details;
  23.                 }
  24.                
  25.                 /**
  26.                  * getUnrelatedProjects
  27.                  * Return array of project id's (from $all_project_ids) that are not present in $related_project_ids
  28.                  */
  29.                 public function getUnrelatedProjects() {
  30.                         return array();
  31.                 }
  32.                
  33.                 /**
  34.                  * List any errors in the following function?
  35.                  * and what does it return?
  36.                  */
  37.                 public function whatIsWrongWithMe() {
  38.                         $project_time = "1hour";
  39.                         $$project_time = "2hours";
  40.                         $estimate =  empty($project_time) ? "3hours" : isset($$project_time) ? "4hours" : "5hours";
  41.                         $prj = new Project();
  42.                         return gettype($prj) . Project::tableName;
  43.                 }
  44.  
  45.         }
  46. ?>