本文整理匯總了PHP中Hubzero\User\Profile::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Profile::delete方法的具體用法?PHP Profile::delete怎麽用?PHP Profile::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Hubzero\User\Profile
的用法示例。
在下文中一共展示了Profile::delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: removeTask
/**
* Removes a profile entry, associated picture, and redirects to main listing
*
* @return void
*/
public function removeTask()
{
// Check for request forgeries
Request::checkToken();
// Incoming
$ids = Request::getVar('ids', array());
// Do we have any IDs?
if (!empty($ids)) {
// Loop through each ID and delete the necessary items
foreach ($ids as $id) {
$id = intval($id);
// Delete any associated pictures
$path = PATH_APP . DS . trim($this->config->get('webpath', '/site/members'), DS) . DS . \Hubzero\Utility\String::pad($id);
if (!file_exists($path . DS . $file) or !$file) {
$this->setError(Lang::txt('COM_MEMBERS_FILE_NOT_FOUND'));
} else {
unlink($path . DS . $file);
}
// Remove any contribution associations
$assoc = new \Components\Members\Tables\Association($this->database);
$assoc->authorid = $id;
$assoc->deleteAssociations();
// Remove the profile
$profile = new Profile();
$profile->load($id);
$profile->delete();
}
}
// Output messsage and redirect
App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false), Lang::txt('COM_MEMBERS_REMOVED'));
}