我在Zend框架中有一个方法
public static function selectWithWhere(array $row_names, array $values) {
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$selectData = new Zend_Db_Select($db);
$selectData->from('other_directions');
$i = 0;
$length = count($values);
$where = array();
foreach($row_names as $row_name){
$where[] = $selectData->where($row_name . '=?', $values[$i]);
$i++;
}
$where[$length - 1];
$data = $db->query($selectData);
$data = $data->fetchAll();
$allDirections[] = array();
if($data == null){
return null;
}
foreach ($data as $d) {
$direction = new Admin_Object_OtherDirections();
$direction->setOtherDirectionId($d['other_direction_id']);
$direction->setNoticeId($d['notice_id']);
$direction->setDirectionTypeId($d['direction_type_id']);
$direction->setOtherDirectionName($d['other_direction_name']);
if(isset($direction)){
$allDirections[] = $direction;
}
}
$allDirections = array_values($allDirections);
return $allDirections;
} …Run Code Online (Sandbox Code Playgroud) 我正在研究Zend Framework.我有问题Zend_Auth.
我必须得到所有登录用户.我怎样才能做到这一点?