當前位置: 首頁>>代碼示例>>PHP>>正文


PHP dao類代碼示例

本文整理匯總了PHP中dao的典型用法代碼示例。如果您正苦於以下問題:PHP dao類的具體用法?PHP dao怎麽用?PHP dao使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了dao類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: verificaLogin

 public function verificaLogin()
 {
     $dao = new dao();
     $sql = sprintf($this->sqlVerificaLogin, $this->getUsuario(), $this->getSenha());
     $result = $dao->query($sql);
     return $result[0]['qtd'];
 }
開發者ID:juceliofeitoza,項目名稱:MyTest,代碼行數:7,代碼來源:Ausuario.php

示例2: addPhoto

 public function addPhoto($photo, $product_id)
 {
     $dao = new dao();
     try {
         $dao->edit("product", "photo", $photo, "id", $product_id);
     } catch (Exception $e) {
         throw new Exception("Failed addging url picture message: " . $e->getMessage());
     }
 }
開發者ID:andreseloysv,項目名稱:happy,代碼行數:9,代碼來源:productController.php

示例3: storeModel

 /**
  *
  * @param <String> $rev_id
  * @param <String> $sessionId
  * @param <Object> $model boModel
  * @param <Object> $blobCB=0 (should have been a causal barrier object but
  * not used yet)
  */
 static function storeModel($rev_id, $sessionId, $model, $blobCB)
 {
     wfDebugLog('p2p', ' -> store model into revid : ' . $rev_id . ' sessionid : ' . $sessionId . ' model : ' . $model->getText());
     try {
         $dao = new dao();
         $dao->storeModel($rev_id, $sessionId, $model, $blobCB);
     } catch (Exception $e) {
         die($e->getMessage());
         throw new MWException(__METHOD__ . ' db access problems');
     }
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:19,代碼來源:DSMW_RevisionManager.php

示例4: addMe

 public function addMe($id_event, $id_product, $id_user, $date_ini)
 {
     $dao = new dao();
     $product = array("id_event" => $id_event, "id_product" => $id_product, "id_user" => $id_user, "date_ini" => $date_ini);
     try {
         $returnObject = $dao->inster($product, "product");
     } catch (Exception $e) {
         throw new Exception("Failed product addMe: " . $e->getMessage());
     }
     return $this->addData($returnObject);
 }
開發者ID:andreseloysv,項目名稱:happy,代碼行數:11,代碼來源:productEventUserController.php

示例5: demarrer

 function demarrer()
 {
     $dao = new dao();
     $tab_installations = $dao->getInstallations($this->recherche);
     $html = "";
     $vue = new vueInstallation();
     foreach ($tab_installations as $installation) {
         $html .= $vue->generer1Installation($installation);
     }
     $vue->afficher($html);
 }
開發者ID:Gregooz,項目名稱:OpenData,代碼行數:11,代碼來源:CtrlRecherche.php

示例6: addMe

 public function addMe($nick, $password, $email, $name)
 {
     $dao = new dao();
     $club = array("email" => $email, "name" => $name);
     try {
         $returnObject = $dao->inster($club, "club");
     } catch (Exception $e) {
         throw new Exception("Failed club addMe: " . $e->getMessage());
     }
     return $this->addData($returnObject);
 }
開發者ID:andreseloysv,項目名稱:happy,代碼行數:11,代碼來源:club.php

示例7: show

 /**
  * Display the specified resource.
  *
  * @param $lang
  * @param  int $code
  * @return \Illuminate\Http\Response
  */
 public function show($lang, $code)
 {
     header('Content-Type: application/json');
     header('Access-Control-Allow-Origin: *');
     $properties['country'] = Input::get('country');
     $properties['flow'] = Input::get('flow');
     $properties['from_date'] = Input::get('from_date');
     $properties['to_date'] = Input::get('to_date');
     $properties['lang'] = $lang;
     $commodity = $this->dao->getCommodity($code, $properties);
     if (empty($commodity)) {
         return response('No data found', Response::HTTP_NO_CONTENT);
     }
     $response = json_encode($commodity, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
     return response($response, Response::HTTP_OK);
 }
開發者ID:is-sam,項目名稱:CPAPI,代碼行數:23,代碼來源:APIController.php

示例8: edit

 /**
  * Edit a build.
  * 
  * @param  int    $buildID 
  * @access public
  * @return void
  */
 public function edit($buildID)
 {
     if (!empty($_POST)) {
         $changes = $this->build->update($buildID);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         if ($changes) {
             $actionID = $this->loadModel('action')->create('build', $buildID, 'edited');
             $this->action->logHistory($actionID, $changes);
         }
         die(js::locate(inlink('view', "buildID={$buildID}"), 'parent'));
     }
     $this->loadModel('story');
     $this->loadModel('bug');
     $this->loadModel('project');
     /* Set menu. */
     $build = $this->build->getById((int) $buildID);
     $this->project->setMenu($this->project->getPairs(), $build->project);
     /* Get stories and bugs. */
     $orderBy = 'status_asc, stage_asc, id_desc';
     $stories = $this->story->getProjectStories($build->project, $orderBy);
     $bugs = $this->bug->getProjectBugs($build->project);
     /* Assign. */
     $this->view->title = $this->lang->build->edit;
     $this->view->position[] = $this->lang->build->edit;
     $this->view->products = $this->project->getProducts($build->project);
     $this->view->build = $build;
     $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $build->builder);
     $this->view->stories = $stories;
     $this->view->bugs = $bugs;
     $this->view->orderBy = $orderBy;
     $this->display();
 }
開發者ID:laiello,項目名稱:zentaoms,代碼行數:41,代碼來源:control.php

示例9: changePassword

 /**
  * Change password , if use default password ,go to change
  * 
  * @access public
  * @return void
  */
 public function changePassword()
 {
     if ($this->app->user->account == 'guest') {
         die(js::alert('guest') . js::locate('back'));
     }
     if (!empty($_POST)) {
         $password1 = $_POST['password1'];
         if (!$password1) {
             die(js::error('Please input password!'));
         }
         $isDefult = $this->dao->select('password')->from(TABLE_DEFAULTPASSWORD)->Where('password')->eq($this->post->password1)->fetchAll();
         //如果用戶使用默認密碼則跳到修改密碼界麵
         if ($isDefult) {
             die(js::error('Password can not in default list!') . js::locate($this->createLink('my', 'changePassword', 'type=forbidden'), 'parent'));
         }
         $this->user->updatePassword($this->app->user->id);
         if (dao::isError()) {
             die(js::error(dao::getError()));
         }
         die(js::locate($this->createLink('my', 'profile'), 'parent'));
     }
     $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->changePassword;
     $this->view->position[] = $this->lang->my->changePassword;
     $this->view->user = $this->user->getById($this->app->user->id);
     $this->display();
 }
開發者ID:xupnge1314,項目名稱:project,代碼行數:32,代碼來源:changePassword.php

示例10: create

 /**
  * Create resume. 
  * 
  * @param  int    $contactID 
  * @param  object $resume 
  * @access public
  * @return int
  */
 public function create($contactID, $resume = null)
 {
     if (empty($resume)) {
         $resume = fixer::input('post')->add('contact', $contactID)->remove('newCustomer,type,size,status,level,name')->get();
         if ($this->post->newCustomer) {
             $customer = new stdclass();
             $customer->name = $this->post->name;
             $customer->type = $this->post->type;
             $customer->size = $this->post->size;
             $customer->status = $this->post->status;
             $customer->level = $this->post->level;
             $customer->assignedTo = $this->app->user->account;
             $customer->createdBy = $this->app->user->account;
             $customer->createdDate = helper::now();
             $return = $this->loadModel('customer')->create($customer);
             if ($return['result'] == 'fail') {
                 return false;
             }
             $resume->customer = $return['customerID'];
             $this->loadModel('action')->create('customer', $resume->customer, 'Created');
         }
     }
     $this->dao->insert(TABLE_RESUME)->data($resume)->autoCheck()->batchCheck($this->config->resume->require->create, 'notempty')->exec();
     if (!dao::isError()) {
         $resumeID = $this->dao->lastInsertID();
         $this->dao->update(TABLE_CONTACT)->set('resume')->eq($resumeID)->where('id')->eq($contactID)->exec();
         return $resumeID;
     }
     return false;
 }
開發者ID:leowh,項目名稱:colla,代碼行數:38,代碼來源:model.php

示例11: batchCreate

 /**
  * Create a batch case.
  * 
  * @access public
  * @return void
  */
 function batchCreate($productID)
 {
     $now = helper::now();
     $cases = fixer::input('post')->get();
     for ($i = 0; $i < $this->config->testcase->batchCreate; $i++) {
         if ($cases->type[$i] != '' and $cases->title[$i] != '') {
             $data[$i]->product = $productID;
             $data[$i]->module = $cases->module[$i] == 'same' ? $i == 0 ? 0 : $data[$i - 1]->module : $cases->module[$i];
             $data[$i]->type = $cases->type[$i] == 'same' ? $i == 0 ? '' : $data[$i - 1]->type : $cases->type[$i];
             $data[$i]->story = $cases->story[$i] == 'same' ? $i == 0 ? 0 : $data[$i - 1]->story : $cases->story[$i];
             $data[$i]->title = $cases->title[$i];
             $data[$i]->openedBy = $this->app->user->account;
             $data[$i]->openedDate = $now;
             $data[$i]->status = 'normal';
             $data[$i]->version = 1;
             if ($data[$i]->story != 0) {
                 $data[$i]->storyVersion = $this->loadModel('story')->getVersion($this->post->story);
             }
             $this->dao->insert(TABLE_CASE)->data($data[$i])->autoCheck()->batchCheck($this->config->testcase->create->requiredFields, 'notempty')->exec();
             if (dao::isError()) {
                 echo js::error(dao::getError());
                 die(js::reload('parent'));
             }
             $caseID = $this->dao->lastInsertID();
             $actionID = $this->loadModel('action')->create('case', $caseID, 'Opened');
         } else {
             unset($cases->module[$i]);
             unset($cases->type[$i]);
             unset($cases->story[$i]);
             unset($cases->title[$i]);
         }
     }
 }
開發者ID:shshenpengfei,項目名稱:scrum_project_manage_system,代碼行數:39,代碼來源:model.php

示例12: admin

 /**
  * Block Admin Page.
  * 
  * @param  int    $index 
  * @param  string $blockID 
  * @access public
  * @return void
  */
 public function admin($index = 0, $blockID = '')
 {
     $this->app->loadLang('block', 'sys');
     $title = $index == 0 ? $this->lang->block->createBlock : $this->lang->block->editBlock;
     if (!$index) {
         $index = $this->block->getLastKey('team') + 1;
     }
     if ($_POST) {
         $this->block->save($index, 'system', 'team');
         if (dao::isError()) {
             $this->send(array('result' => 'fail', 'message' => dao::geterror()));
         }
         $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->server->http_referer));
     }
     $block = $this->block->getBlock($index, 'team');
     $blockID = $blockID ? $blockID : ($block ? $block->block : '');
     $blocks = json_decode($this->block->getAvailableBlocks(), true);
     $this->view->blocks = array_merge(array(''), $blocks);
     $this->view->title = $title;
     $this->view->params = $blockID ? json_decode($this->block->{'get' . ucfirst($blockID) . 'Params'}(), true) : array();
     $this->view->blockID = $blockID;
     $this->view->block = $block;
     $this->view->index = $index;
     $this->display();
 }
開發者ID:leowh,項目名稱:colla,代碼行數:33,代碼來源:control.php

示例13: update

 /**
  * update an address. 
  * 
  * @param  int    $id 
  * @access public
  * @return void
  */
 public function update($id)
 {
     $product = new stdclass();
     $address = fixer::input('post')->add('account', $this->app->user->account)->get();
     $this->dao->update(TABLE_ADDRESS)->data($address)->where('id')->eq($id)->beginIf(RUN_MODE == 'front')->andWhere('account')->eq($this->app->user->account)->fi()->batchCheck($this->config->address->require->edit, 'notempty')->exec();
     return !dao::isError();
 }
開發者ID:qiaqiali,項目名稱:chanzhieps,代碼行數:14,代碼來源:model.php

示例14: install

 /**
  * Install web app. 
  * 
  * @param  int    $webappID 
  * @access public
  * @return void
  */
 public function install($webappID)
 {
     $result = $this->webapp->install($webappID);
     if (dao::isError()) {
         $this->send(array('result' => 'fail', 'message' => dao::getError(), 'locate' => $this->createLink('webapp', 'obtain')));
     }
     $this->send(array('result' => 'success', 'message' => $this->lang->webapp->successInstall, 'locate' => $this->createLink('entry', 'admin'), 'entries' => $this->loadModel('entry')->getJSONEntries()));
 }
開發者ID:leowh,項目名稱:colla,代碼行數:15,代碼來源:control.php

示例15: delete

 /**
  * Delete an address.
  * 
  * @param  int    $id 
  * @access public
  * @return void
  */
 public function delete($id)
 {
     $this->dao->delete()->from(TABLE_ADDRESS)->where('id')->eq($id)->andWhere('account')->eq($this->app->user->account)->exec();
     if (dao::isError()) {
         $this->send(array('result' => 'fail', 'message' => dao::getError()));
     }
     $this->send(array('result' => 'success', 'message' => $this->lang->deleteSuccess, 'locate' => inlink('browse')));
 }
開發者ID:peirancao,項目名稱:chanzhieps,代碼行數:15,代碼來源:control.php


注:本文中的dao類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。