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


PHP Facade::trashAll方法代碼示例

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


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

示例1: login

 /**
  * Logs admin into the system
  * @param $login
  * @param $password
  * @return \SkullyAdmin\Models\Admin|null
  */
 public function login($login, $password)
 {
     /** @var \RedBean_SimpleModel $adminBean */
     $adminBean = R::findOne('admin', "status = ? and email = ?", array(Admin::STATUS_ACTIVE, $login));
     if (!empty($adminBean)) {
         /** @var \SkullyAdmin\Models\Admin $admin */
         $admin = $adminBean->box();
         if ($admin->get('password_hash') == UtilitiesHelper::toHash($password, $admin->get('salt'), $this->app->config('globalSalt'))) {
             $adminSessions = R::find('adminsession', "admin_id = ?", array($admin->getID()));
             if (!empty($adminSessions)) {
                 R::trashAll($adminSessions);
             }
             // when everything ok, regenerate session
             session_regenerate_id(true);
             // change session ID for the current session and invalidate old session ID
             $adminId = $admin->getID();
             $sessionId = session_id();
             $adminsession = $this->app->createModel('adminsession', array("admin_id" => $adminId, "session_id" => $sessionId));
             $this->app->getSession()->set('adminId', $admin->getID());
             R::store($adminsession);
             return $admin;
         }
     }
     return null;
 }
開發者ID:skullyframework,項目名稱:skully-admin,代碼行數:31,代碼來源:AdminRepository.php

示例2: testMultiDeleteUpdate

 /**
  * Test trashAll().
  */
 public function testMultiDeleteUpdate()
 {
     testpack('test multi delete and multi update');
     $beans = R::dispenseLabels('bean', array('a', 'b'));
     $ids = R::storeAll($beans);
     asrt((int) R::count('bean'), 2);
     R::trashAll(R::batch('bean', $ids));
     asrt((int) R::count('bean'), 0);
     testpack('test assocManager check');
     $rb = new OODB(R::getWriter());
     try {
         $rb->getAssociationManager();
         fail();
     } catch (RedException $e) {
         pass();
     }
 }
開發者ID:AntonyAntonio,項目名稱:phpback,代碼行數:20,代碼來源:Misc.php

示例3: deletePackageCost

function deletePackageCost($id)
{
    $packageCost = R::find('packagecost', 'id=?', [$id]);
    R::trashAll($packageCost);
}
開發者ID:pierrerispal,項目名稱:ppe_gsb_API_cost_managment,代碼行數:5,代碼來源:api_function.php

示例4: delete

 /**
  * @param int $qid
  *
  * @return void
  */
 public function delete($qid)
 {
     Facade::trash('questions', $qid);
     $answersToDelete = Facade::findAll('answers', 'qid = :qid', [':qid' => $qid]);
     Facade::trashAll($answersToDelete);
 }
開發者ID:AsemKhatib,項目名稱:MyPoll-OOP-PHP-Poll-system,代碼行數:11,代碼來源:questions.class.php


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