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


PHP Members::delete方法代碼示例

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


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

示例1: do_delete_objects

 function do_delete_objects($objects, $permanent = false)
 {
     $err = 0;
     // count errors
     $succ = 0;
     // count files deleted
     foreach ($objects as $object) {
         try {
             $obj = Objects::findObject($object->getId());
             if ($obj instanceof ContentDataObject && $obj->canDelete(logged_user())) {
                 if ($permanent) {
                     if (Plugins::instance()->isActivePlugin('mail') && $obj instanceof MailContent) {
                         $obj->delete(false);
                     } else {
                         $obj->delete();
                         Members::delete(array("conditions" => "object_id = " . $obj->getId()));
                     }
                     ApplicationLogs::createLog($obj, ApplicationLogs::ACTION_DELETE);
                     $succ++;
                 } else {
                     if ($obj->isTrashable()) {
                         $obj->trash();
                         ApplicationLogs::createLog($obj, ApplicationLogs::ACTION_TRASH);
                         $succ++;
                     }
                 }
             }
         } catch (Exception $e) {
             $err++;
         }
     }
     return array($succ, $err);
 }
開發者ID:rorteg,項目名稱:fengoffice,代碼行數:33,代碼來源:ObjectController.class.php

示例2:

 * You should have received a copy of the GNU General Public License
 * along with Pusthaka.  If not, see <http://www.gnu.org/licenses/>.
 */

	$allow = "ADMIN;LIBSTAFF";
//$allow = "ADMIN";
	$PageTitle = "Edit Member";
	require('../inc/init.php');

	$mem = new Members;
	
	// DELETE Member
	if(isset($_REQUEST['BtnDeleteMember'])){
		$mid = $_REQUEST['mid'];
		$member = $mem->getByID($mid);		
		$mem->delete($member);
	}


	// Update member /////////////////////////////////////////////////////
	if(isset($_REQUEST['BtnUpdateMember'])){
		//[Fill a member data object] ------------------------------
		$member['mid'] = $_REQUEST['mid'];
		$member['mem_no'] = $_REQUEST['mem_no'];
		$member['type'] = $_REQUEST['type'];
		$member['surname'] = $_REQUEST['surname'];
		$member['firstnames'] = $_REQUEST['firstnames'];
		$member['title'] = $_REQUEST['title'];
		$member['address'] = $_REQUEST['address'];
		$member['nic'] = $_REQUEST['nic'];
		$member['reg_no'] = $_REQUEST['reg_no'];
開發者ID:nalaka,項目名稱:pusthaka1,代碼行數:31,代碼來源:member_edit.php

示例3: delete

 public function delete($id = '')
 {
     /***********************************
     		Delete members
     		************************************/
     $members = new Members($this->db);
     $this->f3->set('member', $members->read(array('id=?', $id), [])[0]);
     $this->f3->set('SESSION.flash', array());
     if ($_SERVER['QUERY_STRING'] == "execute") {
         $members->delete($this->f3->get('member')->id);
         $this->f3->push('SESSION.flash', array('type' => 'success', 'msg' => 'Member ' . $this->f3->get('member')->name . ' deleted!'));
         $this->f3->reroute('/mytcg/members');
     }
     $this->f3->set('content', 'app/views/mytcg/members_delete.htm');
     echo Template::instance()->render('app/templates/admin.htm');
 }
開發者ID:Renako,項目名稱:mytcg-f3,代碼行數:16,代碼來源:MyMembersController.php


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