Something
public php v1 · immutablepublic function accessTypesAction(){ // initialize output array, data, to be populated by foreach, below. $data = array(); foreach(Zend::registry('databases')->default ->query("call get_access_types_list()") ->fetchAll(PDO::FETCH_OBJ) as $id => $accessType) { $data[$accessType->id] = $accessType->description; } $this->getResponse()->setBody(Zend_Json::encode($data)); }