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


PHP object::delete方法代碼示例

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


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

示例1: delete

 /**
  * Delete an account
  *
  * @param integer $account_id the account to delete
  * @return boolean was the account deleted?
  */
 public function delete($accountid)
 {
     if (parent::delete($accountid)) {
         return $this->ldap->delete($accountid);
     }
     return false;
 }
開發者ID:HaakonME,項目名稱:porticoestate,代碼行數:13,代碼來源:class.accounts_sqlldap.inc.php

示例2: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $c = strtolower($this->argument('controller'));
     $files = [];
     $files[] = mkny_models_path($c) . '.php';
     $files[] = mkny_model_config_path($c) . '.php';
     $files[] = mkny_presenters_path($c) . 'Presenter.php';
     $files[] = mkny_controllers_path($c) . 'Controller.php';
     $files[] = mkny_requests_path($c) . 'Request.php';
     $files[] = mkny_lang_path(\App::getLocale() . '/' . $c) . '.php';
     $errors = [];
     foreach ($files as $file) {
         if (!$this->files->exists($file)) {
             $errors[] = $file;
         }
     }
     if (!$this->option('force') && count($errors)) {
         $this->error("Nao foi possivel executar o delete-automatico!\nAlguns arquivos estao ausentes!");
     } else {
         if ($this->option('force') || $this->confirm("Deseja realmente remover os arquivos: \n'" . implode("',\n'", $files))) {
             foreach ($files as $file) {
                 $this->files->delete($file);
             }
             $this->info('Deleted!');
         }
     }
 }
開發者ID:mkny,項目名稱:cinimod,代碼行數:32,代碼來源:MknyDeleter.php

示例3: testRoleSynchronisation

 /**
  * Test role synchronisation
  */
 public function testRoleSynchronisation()
 {
     // create a first test ACL role
     $query = $this->model->insert()->into('acl_role')->values(['name' => 'test role 1']);
     $statement = $this->model->prepareStatementForSqlObject($query);
     $statement->execute();
     $this->aclRolesIds[] = $this->model->getAdapter()->getDriver()->getLastGeneratedValue();
     // create a test user
     $query = $this->model->insert()->into('user_list')->values(['nick_name' => Rand::getString(32), 'email' => Rand::getString(32), 'role' => $this->aclRolesIds[0]]);
     $statement = $this->model->prepareStatementForSqlObject($query);
     $statement->execute();
     $this->usersIds[] = $this->model->getAdapter()->getDriver()->getLastGeneratedValue();
     // delete the created ACL role
     $query = $this->model->delete()->from('acl_role')->where(['id' => $this->aclRolesIds[0]]);
     $statement = $this->model->prepareStatementForSqlObject($query);
     $statement->execute();
     // fire the delete ACL role event
     AclEvent::fireDeleteAclRoleEvent($this->aclRolesIds[0]);
     // check the created test user's role
     $select = $this->model->select();
     $select->from('user_list')->columns(['role'])->where(['user_id' => $this->usersIds[0]]);
     $statement = $this->model->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $result = $resultSet->initialize($statement->execute());
     // user must be a default member
     $this->assertEquals($result->current()['role'], AclBaseModel::DEFAULT_ROLE_MEMBER);
 }
開發者ID:spooner77,項目名稱:dream-cms,代碼行數:30,代碼來源:DeleteRoleTest.php

示例4: testDelete

 /**
  * testDelete function
  *
  * @return void
  * @access public
  */
 function testDelete()
 {
     // Without params
     $this->Shell->delete();
     $this->Shell->expectAt(0, 'out', array(new PatternExpectation('/Usage/')));
     // Invalid config
     $this->Shell->args = array('cache_test');
     $this->Shell->delete();
     $this->Shell->expectAt(0, 'err', array(new PatternExpectation('/not found/')));
     $this->Shell->expectCallCount('_stop', 2);
     Cache::config('cache_test', Cache::config('default'));
     // With config
     Cache::write('anything', array('a'), 'cache_test');
     Cache::write('anything2', array('b'), 'cache_test');
     $this->assertTrue(Cache::read('anything', 'cache_test') !== false);
     $this->Shell->args = array('cache_test');
     $this->Shell->delete();
     $this->assertFalse(Cache::read('anything', 'cache_test'));
     // With config
     Cache::write('anything', array('a'), 'cache_test');
     Cache::write('anything2', array('b'), 'cache_test');
     $this->assertTrue(Cache::read('anything', 'cache_test') !== false);
     $this->Shell->args = array('cache_test', 'anything');
     $this->Shell->delete();
     $this->assertFalse(Cache::read('anything', 'cache_test'));
     $this->assertTrue(Cache::read('anything2', 'cache_test') !== false);
 }
開發者ID:sams,項目名稱:cache,代碼行數:33,代碼來源:cache_shell.test.php

示例5: tearDown

 /**
  * Tear down
  */
 protected function tearDown()
 {
     // delete a test user
     if ($this->userIds) {
         $query = $this->model->delete()->from('user_list')->where([new InPredicate('user_id', $this->userIds)]);
         $statement = $this->model->prepareStatementForSqlObject($query);
         $statement->execute();
         $this->userIds = [];
     }
 }
開發者ID:spooner77,項目名稱:dream-cms,代碼行數:13,代碼來源:ApplicationSlugTest.php

示例6: tearDown

 /**
  * Tear down
  */
 protected function tearDown()
 {
     // clear test settings
     if ($this->settingsNames) {
         $query = $this->settingModel->delete()->from('application_setting')->where(['name' => $this->settingsNames]);
         $statement = $this->settingModel->prepareStatementForSqlObject($query);
         $statement->execute();
         $this->settingsNames = [];
     }
 }
開發者ID:spooner77,項目名稱:dream-cms,代碼行數:13,代碼來源:ApplicationServiceTest.php

示例7: replaceAndSave

 /**
  * Open haystack, find and replace needles, save haystack
  * @param  string $oldFile The haystack
  * @param  mixed  $search  String or array to look for (the needles)
  * @param  mixed  $replace What to replace the needles for?
  * @param  string $newFile Where to save, defaults to $oldFile
  * @param  boolean $deleteOldFile Whether to delete $oldFile or not
  * @return void
  */
 public function replaceAndSave($oldFile, $search, $replace, $newFile = null, $deleteOldFile = false)
 {
     $newFile = $newFile === null ? $oldFile : $newFile;
     $file = $this->files->get($oldFile);
     $replacing = str_replace($search, $replace, $file);
     $this->files->put($newFile, $replacing);
     if ($deleteOldFile) {
         $this->files->delete($oldFile);
     }
 }
開發者ID:laravolt,項目名稱:packer,代碼行數:19,代碼來源:PackerHelper.php

示例8: delete

 /**
  * Deletes an item out of the cache, or multiple items
  *
  * @param string|array $key
  * @return int
  */
 public function delete($key)
 {
     $delCount = 0;
     foreach (array_filter((array) $key) as $cacheKey) {
         if ($this->memcached->delete($key)) {
             ++$delCount;
         }
     }
     return $delCount;
 }
開發者ID:jinshana,項目名稱:tangocms,代碼行數:16,代碼來源:Memcached.php

示例9: delete

 /**
  * 刪除文章評論
  *
  * @access public
  */
 public function delete()
 {
     if (!($id = Request::input('id'))) {
         return responseJson(Lang::get('common.action_error'));
     }
     $id = array_map('intval', (array) $id);
     $comment = $this->commentModel->getCommentInIds($id);
     if ($this->commentProcess->delete($id)) {
         $this->setActionLog(['comment' => $comment]);
         return responseJson(Lang::get('common.action_success'), true);
     }
     return responseJson($this->commentProcess->getErrorMessage());
 }
開發者ID:mikegit2014,項目名稱:laravelback,代碼行數:18,代碼來源:CommentController.php

示例10: delete

 /**
  * 刪除文章分類
  *
  * @access public
  */
 public function delete()
 {
     if (!($id = Request::input('id'))) {
         return responseJson(Lang::get('common.action_error'));
     }
     if (!is_array($id)) {
         $id = array($id);
     }
     $id = array_map('intval', $id);
     if ($this->tagProcess->delete($id)) {
         $this->setActionLog(['id' => $id]);
         return responseJson(Lang::get('common.action_success'), true);
     }
     return responseJson($this->tagProcess->getErrorMessage());
 }
開發者ID:mikegit2014,項目名稱:laravelback,代碼行數:20,代碼來源:TagsController.php

示例11: deleteConfig

 /**
  * Delete a config from the database
  *
  * @param   object  &$config    reference to a {@link XoopsConfigItem}
  */
 function deleteConfig(&$config)
 {
     if (!$this->_cHandler->delete($config)) {
         return false;
     }
     $options =& $config->getConfOptions();
     $count = count($options);
     if ($count == 0) {
         $options = $this->getConfigOptions(new Criteria('conf_id', $config->getVar('conf_id')));
         $count = count($options);
     }
     if (is_array($options) && $count > 0) {
         for ($i = 0; $i < $count; $i++) {
             $this->_oHandler->delete($options[$i]);
         }
     }
     if (!empty($this->_cachedConfigs[$config->getVar('conf_modid')][$config->getVar('conf_catid')])) {
         unset($this->_cachedConfigs[$config->getVar('conf_modid')][$config->getVar('conf_catid')]);
     }
     xoops_load("cache");
     $key = "config_" . intval($config->getVar('conf_modid')) . "_" . intval($config->getVar('conf_catid'));
     if (XoopsCache::read($key)) {
         XoopsCache::delete($key);
     }
     return true;
 }
開發者ID:yunsite,項目名稱:xoopsdc,代碼行數:31,代碼來源:config.php

示例12: delete_system_by_gid

 /**
  * Remove payment system object by GUID
  * 
  * @param string $gid system GUID
  * @return void
  */
 public function delete_system_by_gid($gid)
 {
     $this->DB->where("gid", $gid);
     $this->DB->delete(PAYMENTS_SYSTEMS_TABLE);
     unset($this->systems_cache[$gid]);
     return;
 }
開發者ID:Aspirant2011,項目名稱:pelsukov.com,代碼行數:13,代碼來源:payment_systems_model.php

示例13: delete

 /**
  * 刪除數據
  *
  * @author          liu21st <liu21st@gmail.com>
  * @lastmodify      2013-01-21 15:03:16 by mrmsl
  *
  * @param array $options 參數表達式
  *
  * @return bool true刪除成功,否則false
  */
 public function delete($options = array())
 {
     if (empty($options) && empty($this->_options['where'])) {
         if (!empty($this->_data) && isset($this->_data[$v = $this->getPk()])) {
             //如果刪除條件為空 則刪除當前數據對象所對應的記錄
             return $this->delete($this->_data[$v]);
         }
         return false;
     }
     if (is_numeric($options) || is_string($options)) {
         $pk = $this->getPk();
         //根據主鍵刪除記錄
         $where[$pk] = strpos($options, ',') ? array('IN', $options) : $options;
         $pk_value = $where[$pk];
         $options = array('where' => $where);
     }
     $options = $this->_parseOptions($options);
     //分析表達式
     $result = $this->_db->delete($options);
     if (false !== $result) {
         $data = array();
         isset($pk_value) && ($data[$pk] = $pk_value);
         $this->_afterDelete($data, $options);
     }
     return $result;
 }
開發者ID:yunsite,項目名稱:yablog,代碼行數:36,代碼來源:Model.class.php

示例14: delete

 /**
  * Deletes a cache file based on unique key.
  *
  * @since 6.2.0
  * @param int|string $key
  *            Unique key of cache file.
  * @param string $namespace
  *            Optional. Where the cache contents are namespaced.
  */
 public function delete($key, $namespace = 'default')
 {
     if (empty($namespace)) {
         $namespace = 'default';
     }
     return $this->_cache->delete($key, $namespace);
 }
開發者ID:parkerj,項目名稱:eduTrac-SIS,代碼行數:16,代碼來源:etsis_Object_Cache.php

示例15: delete

 public function delete($table, $cond, array $bind = array())
 {
     if (empty($this->_database)) {
         return false;
     }
     return $this->_database->delete($table, $cond, $bind);
 }
開發者ID:robinmin,項目名稱:swale,代碼行數:7,代碼來源:mvc.php


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