hehexu

博客园 首页 新随笔 联系 订阅 管理
if($this->rights=="none"){
$publicsfields=array("CabinetID","DataCenterID",'Location','LocationSortable','ZoneID');
//$this as $prop=>$value 对象的属性可以向数组一样进行操作,
foreach($this as $prop=>$value){
if(!in_array($prop,$publicfields)){
$this->$prop=null;
}
}
}

foreach($cabinetList as $i => $cab){
if($limit && ($cab->MapX1==$cab->MapX2 || $cab->MapY1==$cab->MapY2)){
//注销数组元素
unset($cabinetList[$i]);
}
}
 
posted on 2018-03-14 22:43  hehexu  阅读(128)  评论(0编辑  收藏  举报