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