本文整理汇总了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);
}
示例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'];
示例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');
}