<?php
 
require_once($_SERVER['DOCUMENT_ROOT'] . '/sys/db.php');

class modControlObject  {
  private $control_sum;
  private $control_def;
  
  public function __construct() {
      
    $dal = new DAL();
 
    $sql = "SELECT id, control, operation FROM controlobject "; 
    $this->control_sum = $dal->query($sql);
  
    $default = array ("id"=>0, "control"=>"", "operation"=>"",
                     "usage_note"=>"");
    $this->control_def = $this->toObject ($default);
  }
  
  
  private function toObject($array) {
  	$object = new stdClass();
  	foreach ($array as $key => $value) {
  		if (is_array($value)) {
  			$value = $this->toObject($value);
  		}
  		$object->$key = $value;
  	}
  	return $object;
  }
  
  public function get($prop) {
    return $this->$prop;
  }
}

?>