当前位置: 首页>>代码示例>>PHP>>正文


PHP R::trash方法代码示例

本文整理汇总了PHP中R::trash方法的典型用法代码示例。如果您正苦于以下问题:PHP R::trash方法的具体用法?PHP R::trash怎么用?PHP R::trash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在R的用法示例。


在下文中一共展示了R::trash方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete_event

function delete_event($id)
{
    $event = R::load('events', $id);
    //reloads our event
    R::trash($event);
    //for one bean
}
开发者ID:sousatg,项目名称:events-backoffice,代码行数:7,代码来源:events.php

示例2: clean

 public static function clean($f3, $filename)
 {
     $total_filesize = R::getCell('select sum(filesize) as total_filesize from cache');
     $cache_total_filesize_limit = $f3->get("UPLOAD.cache_total_size_limit");
     $cache_total_filesize_limit = PFH_File_helper::convert_filesize_in_bytes($cache_total_filesize_limit);
     if ($total_filesize > $cache_total_filesize_limit) {
         $caches = R::find("cache", "ORDER BY datetime");
         $count = count($caches);
         // 只有一個不刪除
         //if ($count < 2) {
         //    return;
         //}
         foreach ($caches as $key => $cache) {
             //不刪除最後一個
             //if ($key > $count - 1) {
             //    return;
             //}
             if ($cache->path === $filename) {
                 continue;
             }
             //throw new Exception("$key $cache->path");
             //echo $cache->path . "<br />";
             if (is_file($cache->path)) {
                 unlink($cache->path);
             }
             $total_filesize = $total_filesize - $cache->filesize;
             R::trash($cache);
             if ($total_filesize < $cache_total_filesize_limit) {
                 break;
             }
         }
     }
 }
开发者ID:rivalinx,项目名称:php-file-host,代码行数:33,代码来源:PFH_Archive_cache.php

示例3: delete_news

function delete_news($id)
{
    $news = R::load('news', $id);
    //reloads our event
    R::trash($news);
    //for one bean
}
开发者ID:sousatg,项目名称:events-backoffice,代码行数:7,代码来源:news.php

示例4: doDeleteById

 public static function doDeleteById($id)
 {
     $user = R::dispense('user');
     $user->id = $id;
     R::trash($user);
     //for one bean
 }
开发者ID:xinerd,项目名称:SP_ROI,代码行数:7,代码来源:UserDAOImpl.class.php

示例5: deleteFromList

 public function deleteFromList($id)
 {
     $ban = R::load('banlist', $id);
     $value = $ban->value;
     R::trash($ban);
     return $value;
 }
开发者ID:zeamxie,项目名称:jobskee-open-source-job-board,代码行数:7,代码来源:Banlist.php

示例6: testRebuilder

 /**
  * Test SQLite table rebuilding.
  * 
  * @return void
  */
 public function testRebuilder()
 {
     $toolbox = R::$toolbox;
     $adapter = $toolbox->getDatabaseAdapter();
     $writer = $toolbox->getWriter();
     $redbean = $toolbox->getRedBean();
     $pdo = $adapter->getDatabase();
     R::dependencies(array('page' => array('book')));
     $book = R::dispense('book');
     $page = R::dispense('page');
     $book->ownPage[] = $page;
     $id = R::store($book);
     $book = R::load('book', $id);
     asrt(count($book->ownPage), 1);
     asrt((int) R::getCell('SELECT COUNT(*) FROM page'), 1);
     R::trash($book);
     asrt((int) R::getCell('SELECT COUNT(*) FROM page'), 0);
     $book = R::dispense('book');
     $page = R::dispense('page');
     $book->ownPage[] = $page;
     $id = R::store($book);
     $book = R::load('book', $id);
     asrt(count($book->ownPage), 1);
     asrt((int) R::getCell('SELECT COUNT(*) FROM page'), 1);
     $book->added = 2;
     R::store($book);
     $book->added = 'added';
     R::store($book);
     R::trash($book);
     asrt((int) R::getCell('SELECT COUNT(*) FROM page'), 0);
 }
开发者ID:daviddeutsch,项目名称:redbean-adaptive,代码行数:36,代码来源:Rebuild.php

示例7: delrole

 /**
  * Check for a role
  *
  * @param string	$contextname    The name of a context...
  * @param string	$rolename       The name of a role....
  *
  * @return void
  */
 public function delrole($contextname, $rolename)
 {
     $cname = R::findOne('rolecontext', 'name=?', array($contextname));
     $rname = R::findOne('rolename', 'name=?', array($rolename));
     $bn = R::findOne('role', 'rolecontext_id=? and rolename_id=? and user_id=? and start <= UTC_TIMESTAMP() and (end is NULL or end >= UTC_TIMESTAMP())', array($cname->getID(), $rname->getID(), $this->bean->getID()));
     if (is_object($bn)) {
         R::trash($bn);
     }
 }
开发者ID:Milwyr,项目名称:University-Publication-Website,代码行数:17,代码来源:model_user.php

示例8: eliminar

 public static function eliminar()
 {
     if (isset($_GET['id'])) {
         $user = R::load('user', $_GET['id']);
         $username = $user->name;
         R::trash($user);
         //$_SESSION['flash'] = "Usuario $username eliminado exitosamente";
     }
 }
开发者ID:arandaschimpf,项目名称:carrito,代码行数:9,代码来源:users.php

示例9: destruir

 public static function destruir()
 {
     global $session, $logged;
     if (isset($logged) && isset($session)) {
         R::trash($session);
         setcookie("logged", "", time() - 1);
         $_SESSION['flash'] = 'Ha cerrado sesión correctamente';
     }
     header('Location:/');
 }
开发者ID:arandaschimpf,项目名称:carrito,代码行数:10,代码来源:sessions.php

示例10: clearInvalidLoginAttempts

 /**
  * Function to clear invalid login attempts 
  * @param string $username email or username of user
  * @return int login attempts left
  * **/
 public function clearInvalidLoginAttempts($username)
 {
     $userRow = \R::findOne('users', 'email=:ui OR user_name = :ui', array(':ui' => $username));
     if ($userRow) {
         $userAttemptRow = \R::findOne($this->_name, 'user_id = :ui', array(':ui' => $userRow->id));
         if ($userAttemptRow) {
             \R::trash($userAttemptRow);
         }
     }
 }
开发者ID:samiksha-singla,项目名称:Api-Framework,代码行数:15,代码来源:UserLoginAttempts.php

示例11: delete_page

 public function delete_page($args)
 {
     $page_id = array_shift($args);
     if ($page = R::load('page', $page_id)) {
         $old = clone $page;
         R::trash($page);
         Audit::create($old, NULL, 'Developer deleted page from system');
     }
     $this->redirect(PACKAGE_URL);
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:10,代码来源:admin.php

示例12: deleteMessage

 public function deleteMessage($user_id, $m_id)
 {
     $message = R::findOne('message', '  recipient_id = ? && id = ? ', [$user_id, $m_id]);
     if ($message == NULL) {
         return NULL;
     }
     R::trash($message);
     $data = array("rc" => 0);
     return json_encode($data);
 }
开发者ID:nebulak,项目名称:PrivateCircle,代码行数:10,代码来源:MessageManager.php

示例13: deleteCity

 public function deleteCity()
 {
     $count = R::count('jobs', " city=:city ", array(':city' => $this->_id));
     if (!$count) {
         $city = R::load('cities', $this->_id);
         R::trash($city);
         return true;
     }
     return false;
 }
开发者ID:zeamxie,项目名称:jobskee-open-source-job-board,代码行数:10,代码来源:Cities.php

示例14: show_deleteUser

 public function show_deleteUser()
 {
     if ($this->user->password != Framework::hash($_POST['password'])) {
         $this->error('Das Passwort war falsch!');
     }
     R::trash($this->user);
     $this->show_Logoff();
     $this->output('deleted', true);
     $this->output('message', 'Der Account wurde gelöscht.');
 }
开发者ID:agrafix,项目名称:managerslife,代码行数:10,代码来源:Ajax_User.class.php

示例15: deleteCategory

 public function deleteCategory()
 {
     $count = R::count('jobs', " category=:category ", array(':category' => $this->_id));
     if (!$count) {
         $category = R::load('categories', $this->_id);
         R::trash($category);
         return true;
     }
     return false;
 }
开发者ID:aescarcha,项目名称:jobskee-open-source-job-board,代码行数:10,代码来源:Categories.php


注:本文中的R::trash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。