当前位置: 首页>>代码示例>>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;未经允许,请勿转载。