zoukankan      html  css  js  c++  java
  • 方法实例

    static function RowToObject($dbRow){
    $st=new SensorTemplate();
    $st->TemplateID=$dbRow["TemplateID"];
    $st->ManufacturerID=$dbRow["ManufacturerID"];
    $st->Model=$dbRow["Model"];
    $st->TemperatureOID=$dbRow["TemperatureOID"];
    $st->HumidityOID=$dbRow["HumidityOID"];
    $st->TempMultiplier=$dbRow["TempMultiplier"];
    $st->HumidityMultiplier=$dbRow["HumidityMultiplier"];
    $st->mUnits=$dbRow["mUnits"];
    return $st;
    }

    //该方法将数据存储到一个实例对象中,而不是存储到$this类本身
    foreach(SensorTemplate::RowToObject($sensorRow) as $prop => $value){
    $this->$prop=$value; //$prop=temp
    }
     $this->$prop=$value;   //$this->temp=$value;
     $this->$prop 指的是对应的变量名称对应值


  • 相关阅读:
    file
    shell脚本的执行
    添加源,删除源
    lsattr, chattr
    umask
    od
    init
    sync
    wc
    history
  • 原文地址:https://www.cnblogs.com/hehexu/p/8319853.html
Copyright © 2011-2022 走看看