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