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


PHP R::trash方法代碼示例

本文整理匯總了PHP中RedBeanPHP\R::trash方法的典型用法代碼示例。如果您正苦於以下問題:PHP R::trash方法的具體用法?PHP R::trash怎麽用?PHP R::trash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在RedBeanPHP\R的用法示例。


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

示例1: delete

 public function delete($id)
 {
     $item = R::findOne('ecatalog', 'id=?', [$id]);
     R::trash($item);
     @unlink('upload/' . $item['pdf_path']);
     @unlink('upload/' . $item['cover_path']);
     $this->slim->redirect($this->slim->request()->getRootUri() . '/ecatalog');
 }
開發者ID:nuiz,項目名稱:duragres,代碼行數:8,代碼來源:ECatalogController.php

示例2: delete

 public function delete($roomId, $id)
 {
     $item = R::findOne('room_pattern', 'id=?', [$id]);
     @unlink('upload/' . $item->picture);
     @unlink('upload/' . $item->thumb);
     R::trash($item);
     $this->slim->redirect($this->slim->request()->getRootUri() . '/room/' . $roomId . '/pattern');
 }
開發者ID:nuiz,項目名稱:duragres,代碼行數:8,代碼來源:RoomPatternController.php

示例3: trash

 public function trash($bean)
 {
     if (is_string($bean) || is_numeric($bean)) {
         return R::trash($this->type, $bean);
     }
     return R::trash($bean);
 }
開發者ID:MhmdLab,項目名稱:redbean-slim,代碼行數:7,代碼來源:BeanRepository.php

示例4: remove

 public function remove()
 {
     $bean = R::findOne('group', ' name = ? ', [$this->name]);
     if ($bean !== null) {
         R::trash($bean);
         return true;
     }
     return false;
 }
開發者ID:enpowi,項目名稱:enpowi,代碼行數:9,代碼來源:Group.php

示例5: deleteUser

 public function deleteUser(Request $request, Response $response, array $args)
 {
     $name = $args['name'];
     if (empty($name)) {
         $this->flash->addMessage('flash', 'No user specified');
         return $response->withRedirect($request->getUri()->getBaseUrl() . $this->router->pathFor('users'));
     }
     $user = R::findOne('users', ' email = ? ', [$name]);
     if (!empty($user)) {
         R::trash($user);
         $this->flash->addMessage('flash', "{$name} deleted");
     } else {
         $this->flash->addMessage('flash', "{$name} User not found");
     }
     return $response->withRedirect($request->getUri()->getBaseUrl() . $this->router->pathFor('users'));
 }
開發者ID:neilmillard,項目名稱:fxtrader,代碼行數:16,代碼來源:UserAction.php

示例6: replace

 public function replace()
 {
     $user = App::user();
     $existingBeans = R::findAll('territory', ' number = :number ', ['number' => $this->number]);
     foreach ($existingBeans as $bean) {
         $copy = R::dispense('territoryedit');
         $copy->geoJson = $bean->geoJson;
         $copy->name = $bean->name;
         $copy->number = $bean->number;
         $copy->locality = $bean->locality;
         $copy->congregation = $bean->congregation;
         $copy->created = $bean->created;
         $copy->createdBy = $bean->createdBy;
         $copy->archived = time();
         $copy->archivedBy = $user->id;
         R::store($copy);
         R::trash($bean);
     }
     $bean = R::dispense('territory');
     $bean->geoJson = $this->geoJson;
     $bean->name = $this->name;
     $bean->number = $this->number;
     $bean->locality = $this->locality;
     $bean->congregation = $this->congregation;
     $bean->created = time();
     $bean->createdBy = $user->id;
     R::store($bean);
     $this->_bean = $bean;
     return $this;
 }
開發者ID:vallevista,項目名稱:etm2.temp,代碼行數:30,代碼來源:Territory.php

示例7: deleteBean

 /**
  * Delete the loaded bean
  * @throws NoBeanException
  */
 public function deleteBean()
 {
     if ($this->currentBean == null) {
         throw new NoBeanException();
     }
     R::trash($this->currentBean);
 }
開發者ID:louislam,項目名稱:louislam-crud,代碼行數:11,代碼來源:LouisCRUD.php

示例8: removeLab

 public function removeLab($id, $school_id = null)
 {
     $sql = ' id = ? ';
     $bindings = [(int) $id];
     if (null !== $school_id) {
         $sql .= ' AND school_id = ? ';
         $bindings[] = (int) $school_id;
     }
     $lab = R::findOne('lab', $sql, $bindings);
     if (null !== $lab) {
         if ($lab->attachment && is_writable($this->filesPath . '/' . $lab->attachment)) {
             unlink($this->filesPath . '/' . $lab->attachment);
         }
         R::trash($lab);
     }
 }
開發者ID:eellak,項目名稱:gredu_labs,代碼行數:16,代碼來源:LabService.php

示例9: removeTeacher

 public function removeTeacher($id)
 {
     R::trash('teacher', $id);
 }
開發者ID:eellak,項目名稱:gredu_labs,代碼行數:4,代碼來源:StaffService.php

示例10: delete

 /**
  * Delete bean from database
  */
 public function delete()
 {
     R::trash($this->_bean);
 }
開發者ID:zigiphp,項目名稱:zigiphp-2,代碼行數:7,代碼來源:BaseModel.php

示例11: delete

 public function delete($id)
 {
     $item = R::findOne('employee', 'id=?', [$id]);
     R::trash($item);
     $this->slim->redirect($this->slim->request()->getRootUri() . '/employee');
 }
開發者ID:nuiz,項目名稱:um,代碼行數:6,代碼來源:EmployeeController.php

示例12: deletePair

 /**
  * @param string $currencyFromCode
  * @param string $currencyToCode
  *
  * @return array
  */
 public static function deletePair($currencyFromCode, $currencyToCode)
 {
     $pair = self::getPairFromDb(self::checkCurrency($currencyFromCode), self::checkCurrency($currencyToCode));
     RedBean::trash($pair);
     return ['success' => true];
 }
開發者ID:pashukhin,項目名稱:traider_test,代碼行數:12,代碼來源:TraiderApi.php

示例13: delete

 /**
  *
  */
 public function delete()
 {
     R::trash($this->table);
 }
開發者ID:jetfirephp,項目名稱:db,代碼行數:7,代碼來源:RedBeanSingleResult.php

示例14: deleteRota

 public function deleteRota(Request $request, Response $response, array $args)
 {
     $name = $args['name'];
     if (empty($name)) {
         $this->flash->addMessage('flash', 'No rota specified');
         return $response->withRedirect($this->router->pathFor('rotas'));
     }
     $rota = R::findOne('rotas', ' name = ? ', [$name]);
     if (!empty($rota)) {
         R::trash($rota);
         R::wipe($name);
         $this->flash->addMessage('flash', "{$name} deleted");
     } else {
         $this->flash->addMessage('flash', "{$name} Rota not found");
     }
     return $response->withRedirect($this->router->pathFor('rotas'));
 }
開發者ID:aodkrisda,項目名稱:oncallslim,代碼行數:17,代碼來源:RotaAction.php

示例15: deleteProduct

 public function deleteProduct($productId)
 {
     $token = $this->slim->request->params('token');
     if (empty($token)) {
         header('Content-Type: application/json');
         echo json_encode(['error' => 'REQUIRE_AUTHORIZE'], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
         exit;
     }
     $account = R::findOne("account", "token = ?", [$token]);
     if (!$account) {
         header('Content-Type: application/json');
         echo json_encode(['error' => 'AUTHORIZE_FAILED'], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
         exit;
     }
     $item = R::findOne("account_product", "account_id=? AND product_id = ?", [$account['id'], $productId]);
     if (!$item) {
         header('Content-Type: application/json');
         echo json_encode(['error' => 'ACCOUNT_PRODUCT_NOT_FOUND'], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
         exit;
     }
     R::trash($item);
     header('Content-Type: application/json');
     echo json_encode(['success' => true], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
     exit;
 }
開發者ID:nuiz,項目名稱:duragres,代碼行數:25,代碼來源:ApiAccountController.php


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