本文整理汇总了PHP中DAL类的典型用法代码示例。如果您正苦于以下问题:PHP DAL类的具体用法?PHP DAL怎么用?PHP DAL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DAL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: soapServer
public function soapServer($request, $response)
{/*{{{*/
$postdata = file_get_contents("php://input");
$function = 'soapServer';
$this->ioLogRecorder->addLog(XDateTime::now()->toString()." service [{$function}] ".$this->ioLogRecorder->format2SimpleLog($postdata));
$configs = ProviderConfigFactory::getProviderAppConfigs(PhoneConference::SPTYPE_HUAWEI, TeleConfProvider::APPTYPE_CONF);
$callbackUrl = $configs['callbackUrl'];
$server = new SoapServer(null, array('uri' => 'HuaweiConfCallback','location'=>$callbackUrl));
$server->setClass('HuaweiTeleConfApi');
try
{
$lockName = $this->getLockerName($postdata);
$cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER);
$locker = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher));
$locker->getLock($lockName);
$server->handle();
$locker->releaseLock($lockName);
}
catch(Exception $ex)
{
$locker->releaseLock($lockName);
}
header("HTTP/1.1 202 Accepted");
header("Content-Type: text/xml;charset=UTF-8");
return parent::DIRECT_OUTPUT;
}/*}}}*/
示例2: setAmbiente
private function setAmbiente($tipo = '')
{
$registrador = new DAL();
$idTipo = $registrador->getTipoDato($tipo, 'id', 'id');
if (!$idTipo) {
return false;
}
$idTipo = $idTipo;
$nombreTipo = $registrador->getTipoDato($tipo, 'id', 'nombre');
$aliasTipo = $registrador->getTipoDato($tipo, 'id', 'alias');
unset($registrador);
return array("id" => $idTipo, "nombre" => $nombreTipo, "alias" => $aliasTipo);
}
示例3: query1
function query1($disorder)
{
echo "jaz sem funkcija";
$dal = new DAL();
$age_min = 18;
$age_max = 36;
$unitarray = array(75, 77, 78);
$disorderarray = array(1, 2, 3, 4, 5);
$cat = $dal->get_count_dissorder_age_persons_by_unit($unit_in, 0, 11, $age_min, $age_max, $disorder);
$cat = $cat[0];
$table = str_replace("##DISORDER{$disorder}##", $cat->sestevek, $table);
echo $table;
return $table;
}
示例4: getUserIdByPatientAttachment
private function getUserIdByPatientAttachment($context)
{/*{{{*/
$encodeId = $context->request->id;
$patientAttachmentId = Codec::getInstance()->decodeId($encodeId);
$patientAttachment = DAL::get()->find('patientattachment',$patientAttachmentId);
return $patientAttachment->user->id;
}/*}}}*/
示例5: getDtoInfos
public static function getDtoInfos(array $tasks)
{
/*{{{*/
$dtoList = array();
foreach ($tasks as $task) {
$patient = $task->patient;
//$ticket = DAL::get()->find_by_source('ticket', $task, true);
$ticket = DAL::get()->find_waiting_ticket('ticket', $task);
if ($ticket->isNull()) {
continue;
}
if (false == isset($dtoList[$patient->user->id])) {
$dtoList[$patient->user->id] = array();
}
$dto = new self();
$dto->id = $ticket->source->id;
$dto->ticketId = $ticket->id;
$dto->ctime = $ticket->ctime;
$dto->inspectorName = $task->inspector->isNull() ? '╬┤ио┼С' : $task->inspector->getRealName();
$dto->patient = $patient;
$dto->level = $task->level;
$dto->source = $task;
$dto->inspectorId = $ticket->inspectorId;
$dto->status = $task->getStatusDesc();
$dto->src = $task->getSrcDesc();
$dto->comment = $task->comment;
$dto->proposal = $task->proposal;
$dtoList[$patient->user->id][] = $dto;
}
return $dtoList;
}
示例6: showAdd
public function showAdd($request, $response)
{
/*{{{*/
$response->id = $request->getRequest('id', 0);
$response->msg = $request->msg;
$response->noteBook = DAL::get()->find('NoteBook', $response->id);
}
示例7: show
public function show($request, $response)
{
/*{{{*/
$response->cates = $this->threadCateClient->getTopLevelList();
$response->auditor = DAL::get()->find('auditor', $request->id);
$res = $this->auditorClient->getByRoles(array(Auditor::ROLE_LEADER));
$response->leaders = isset($res[Auditor::ROLE_LEADER]) ? $res[Auditor::ROLE_LEADER] : array();
$response->groups = DAL::get()->find_all_by_condition('auditorgroup', '1=1');
$response->id = $request->id;
$response->showContent = true;
$response->viewer = $this->auditor;
if (null == $response->id) {
$isGroupLeader = false;
if ($this->auditor->isLeader()) {
foreach ($response->groups as $group) {
if ($group->leader->id == $this->auditor->id) {
$isGroupLeader = true;
}
}
if (false == $isGroupLeader) {
throw new BizException('你还不是任何组的组长,请联系管理员设置');
}
}
}
}
示例8: searchBySphinx
private function searchBySphinx($request, $response, $kw, $p)
{/*{{{*/
$doctorSearchd = SphinxSearchdBase::createSearchdByType('Doctor');
$utf8Kw = mb_convert_encoding($kw, 'utf-8', 'gbk');
$res = $doctorSearchd->query($utf8Kw, ($p - 1) * 15, 15);
$searchResult = SearchResult::sphinxResult2searchResult($res, 'doctor', ($p - 1) * 15, 15);
$response->totalPage = ceil($searchResult->total_found/$searchResult->pageSize);
$results = array();
foreach($searchResult->items as $item)
{/*{{{*/
$doctor = DAL::get()->find('doctor',$item->id);
if($doctor->isNull() || $doctor->deleted > 0 )
{
continue;
}
$result = array();
$result['id'] = $doctor->id;
$result['name'] = $doctor->name;
$result['title'] = $doctor->title;
$result['hospital'] = $doctor->hospitalfaculty->hospital->name;
$result['userid'] = $doctor->getUserId();
$result['hospitalfacultyname'] = $doctor->hospitalfaculty->name ;
$results[] = (object)$result;
}/*}}}*/
return $results;
}/*}}}*/
示例9: service
public function service($request, $response)
{/*{{{*/
ob_start();
$result = "";
$function = $request->service;
if(method_exists($this, $function))
{
try
{
$lockName = $this->getLockerName($request);
$cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER);
$locker = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher));
$locker->getLock($lockName);
$result = $this->$function($request,$response);
$locker->releaseLock($lockName);
}
catch(LockException $ex)
{
$this->ioLogRecorder->addLog(XDateTime::now()->toString()."并发锁错误 $lockName\n");
}
catch(Exception $ex)
{
$locker->releaseLock($lockName);
}
}
echo $result;
header('Content-Length: ' . ob_get_length());
return parent::DIRECT_OUTPUT;
}/*}}}*/
示例10: checkNotice
/**
* checkNotice 接收来自第三方的电话咨询订单验证消息
*
* @access public
* @return void
*/
public function checkNotice()
{/*{{{*/
$data = file_get_contents("php://input");
if(empty($data))
{
echo json_encode(array('errno' => 2, 'detail' => iconv("GBK", "UTF-8", '数据为空')));
exit;
}
$arrData = json_decode($data, true);
$type = $arrData['type'];
$postData = $arrData['postdata'];
$partnerTelOrder = DAL::get()->find_by_tradeid('partnertelorder', $postData['trade_id']);
if(false == $partnerTelOrder->isNull())
{
$telOrder = DAL::get()->find('telorder', $partnerTelOrder->orderId);
if(false == $telOrder->isNull())
{
if(($type == '2' && $telOrder->isRefund()) || ($type == '1' && $telOrder->isFinished()))
{
echo json_encode(array('errno'=>'0'));
ScoreClient::getInstance()->createIntegralLog(User::ADMIN_USERID, $partnerTelOrder->tradeId, IntegralLog::BAIDUZHIDAO_PHONE_DRAWBACK_SUCCESS);
exit;
}
}
}
echo json_encode(array('errno'=>'1'));
ScoreClient::getInstance()->createIntegralLog(User::ADMIN_USERID, $partnerTelOrder->tradeId, IntegralLog::BAIDUZHIDAO_PHONE_DRAWBACK_FAIL);
exit;
}/*}}}*/
示例11: newPost
public function newPost($request, $response)
{
/*{{{*/
$verifyOk = Captcha::verify($request->verifyStr, XIpLocation::getIp(), 'article', $request->article_id, $request->token);
DBC::requireTrue($verifyOk, "您输入的验证码有误!");
//禁用词检查
$title = $request->title;
$result = DoctorClient::getInstance()->getProfanityCheck($title);
DBC::requireFalse($result['CODE'] < 0, "文章 评论添加失败");
DBC::requireFalse($result['CODE'] == 2, "文章 评论添加成功");
$title = $result['CONTENT'];
$content = htmlspecialchars($request->getRequest('content'), ENT_COMPAT | ENT_HTML401, 'ISO-8859-1');
$result = DoctorClient::getInstance()->getProfanityCheck($content);
DBC::requireFalse($result['CODE'] < 0, "文章 评论添加失败");
DBC::requireFalse($result['CODE'] == 2, "文章 评论添加成功");
$content = $result['CONTENT'];
$article = DAL::get()->find('article', $request->article_id);
$feilds = array();
$feilds['ip'] = XIpLocation::getIp();
$feilds['ipLocation'] = XIpLocation::getLocationArea();
$userId = $this->user->isNull() == false ? $this->user->id : '';
$comment = ArticleClient::getInstance()->addComment($article, $userId, $title, $content, $feilds);
squid::clean($article->getUrl(), true);
$this->message('您发表的评论已经提交,待网站审核通过后即可展示。', $response);
}
示例12: modify
function modify($request, $response)
{
/*{{{*/
$this->myProjectOperator->checkAdminAuthOrQuit('update');
$projectOrgId = $request->projectOrgId;
$response->projectOrg = DAL::get()->find('projectOrg', $projectOrgId);
}
示例13: detail
public function detail($request, $response)
{/*{{{*/
$threadId = (int)$request->case_id;
$criticalNum = 100*100*1000;
$correctNum = 100*100*100;
$threadId = $threadId > $criticalNum ? $threadId : $threadId-$correctNum;
$proposal = DAL::get()->find('proposal', $threadId);
if(false == $proposal->isNull())
{
$response->setRedirect($proposal->getTouchUrl());
return 0;
}
else
{
$intention = DAL::get()->find('intention', $threadId);
if(false == $intention->isNull())
{
$response->setRedirect($intention->getTouchUrl());
return 0;
}
else
{
DBC::requireTrue(false, 'Êý¾ÝÎÊÌâ');
}
}
}/*}}}*/
示例14: postTopic
public function postTopic($request, $response)
{
$groupIds = $request->groupIds;
if(!$groupIds)
{
$response->message = '没有选择话题所在的组!';
MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/post', array('delay' => 6, 'button' => 'back'));
return false;
}
$title = $request->title;
$content = preg_replace("/<\/?a[^>]*>/i", "", $request->content);
if(XString::cntrim($title) == '' || XString::cntrim($content) == '')
{
$response->message = '话题标题和内容都不能为空!';
MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/post', array('delay' => 6, 'button' => 'back'));
return false;
}
$groups = DAL::get()->find('regroup', $groupIds);
foreach($groups as $group)
{
if($group->reboard->isNull() == false)
{
$member = ForumClient::getInstance()->getMemberByUserIdAndGroupId($this->user->id, $group->id);
if($member->isNull() == false && $member->isForbiddened())
{
$response->message = '您的发言没有成功,可能是已被禁止发言!服务电话:'.HdfPhoneNumber::PHONE_FENZHEN;
MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/index', array('delay' => 6, 'button' => 'back'));
return false;
}
ResidentEvilClient::getInstance()->createTopic($group->space, $group->reboard, $this->user, $title, $content);
}
}
$response->message = '话题发表成功!';
MsgHtml::msg($response->message, 'http://'.URL_PREFIX.'passport.haodf.com/mypatient/index', array('delay' => 6, 'button' => 'back'));
}
示例15: buildData
private function buildData($facultyList)
{/*{{{*/
$res = array();
$facultyData = array();
if(false == empty($facultyList))
{
$facultys = DAL::get()->find('Faculty', $facultyList['ids']);
foreach($facultys as $faculty)
{
$hospitalFacultyGroup = $this->getHospitalFacultyGroupByFacultyId($faculty->id);
if(count($hospitalFacultyGroup) == 5)
{
$formData = $this->buildFormData($hospitalFacultyGroup, $faculty->id);
$facultyNames = $this->getAllNames($faculty);
if (count($facultyNames)>1)
{
foreach ($facultyNames as $facultyName)
{
$res[] = $this->getRealData($faculty, $formData, $facultyName);
unset($facultyName);
}
}
else
{
$res[] = $this->getRealData($faculty, $formData);
}
}
BeanFinder::get('LocalCache')->removeAll();
unset($faculty);
}
BeanFinder::get('LocalCache')->removeAll();
}
return $res;
}/*}}}*/