cakephp read

字体大小: 中小 标准 ->行高大小: 标准

read
  string $fields
  string $id


根据$fields中的属性名从当前对象中读出对应的值,或者是$id指定的对象中读取。注意:read()方法仅级联读取该对象的一级关联对象,不管 model中的$recursive的值为多少。如果你是希望获取所有级联属性的话,请使用find()或者findAll()方法。

   function testread(){
     $this->autoRender = false;
     
         $result =$this->Operator->read(array('id','loginname'),212);
     echo "<pre>";
    print_r($result);
     echo "</pre>";
     
    }

 

 

 $this->Operator->id = 217;
         $result =$this->Operator->read();

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/784.html